python - Django: adding a random.py file in project dir destroyed the setting's import in WSGI -
this seems weird has happened number of times now. have artitrary .py file added "project/project" directory (same directory settings.py). 2-3 scripts import script.
after adding script , restarting apache, django website shows following errors exclusively:
error from:
raise importerror("could not import settings '%s' (is on sys.path?): %s" % (self.settings_module, e)) [wed jul 24 08:10:03 2013] [error] [client 127.0.0.1] importerror: not import settings 'project.settings' (is on sys.path?): no module named settings
any advice? thank you.
here directory repr:
project/ project/ __init__.py settings.py urls.py views.py wsgi.py something.py app/ __init__.py views.py models.py tasks.py
i tried restore site removing something.py , imports, nothing worked.
update: in wsgi.py file put
print os.getcwd() # prior os.environ.setdefault("django_settings_module", "project.settings") django.core.wsgi import get_wsgi_application application = get_wsgi_application()
and result off! in wrong directory. pointed /home/user/path/to/django/project instead of /home/user, still not work!! makes no sense because settings.py right there, can blatantly import it..
how come random scenario caused this?? , previous times did not. can please explain? thanks.
wow, unbelievable. accidentally had unneeded init.py inside main higher level project folder... causing project.settings @ directory 1 level high!!
Comments
Post a Comment