I'm trying to run django migrations on a freshly installed Heroku instance but was getting a ProgrammingError
. The error was due to some module-level queries that were being performed in a totally separate module and shouldn't be called at all during the migration.
It turns out that the reason they files were being called is because they were in a file that was imported into my urls.py
and, for some reason, Django was loading those urls.
Is there some reason Django must load the urls even though migrations don't depend on them, and is there any way to prevent them from being loaded?