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.
Adding toplevel imports of internal django functions can break django in really non-obvious ways.
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.