[Django]-Suddenly I'm getting DJANGO_SETTINGS_MODULE is not defined when using runserver

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.

Leave a comment