My Directory structure is as follows
microblog/__init__.py
urls.py
views.py
wsgi.py
settings/__init__.py
testing.py
base.py
local.py
In testing.py I have a relative import
from .base import *
...
...more code
When I try to run the testing.py from the command line in the directory microblog/settings using python testing.py
from .base import *
ValueError: Attempted relative import in non-package
Why does this not work. The settings directory is a valid package with a init.py . I do not get the ValueError from the command line only If I change the
from .base import *
to
from base import *
I am trying to understand why the relative local import fails and gives a ValueError when I run the "testing.py" package with a relative import in it from the command line.