3

The full error is:

ImportError: Could not import settings 'app.settings' (Is it on sys.path?): No module named settings

The whole time,

python manage.py runserver

had been working fine, and DJANGO_SETTINGS_MODULE was never defined previously - that is not the issue here, since I'm running manage.py which should set this itself.

The problem occured after I added some imports - runserver immediately stopped working. I also can't do validate - nothing works. Setting DJANGO_SETTINGS_MODULE doesn't help, either, although that's what the error is suggesting.

fastmultiplication
  • 2,951
  • 1
  • 31
  • 39

1 Answers1

4

Adding toplevel imports of internal django functions can break django in really non-obvious ways.

from django.core import context_processors

was in a file that was imported into settings.py pretty early, which caused this error.

In my opinion, django could use a better way to detect this type of problem. The line which caused the problem didn't show up in the traceback at all.

fastmultiplication
  • 2,951
  • 1
  • 31
  • 39