Ryne Everett
unread,Jan 7, 2018, 10:05:34 PM1/7/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mezzani...@googlegroups.com
I would follow the flow of execution to ensure your local_settings are
being sourced. For example, in the default project template:
1. You're running makemigrations through manage.py which defines
DJANGO_SETTINGS_MODULE as the settings.py file in your main project
directory.
settings_module = "%s.settings" % real_project_name("{{ project_name }}")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
2. The settings.py looks for a local_settings.py file in the
main project directory and imports it.
f = os.path.join(PROJECT_APP_PATH, "local_settings.py")
if os.path.exists(f):
import sys
import imp
module_name = "%s.local_settings" % PROJECT_APP
module = imp.new_module(module_name)
module.__file__ = f
sys.modules[module_name] = module
exec(open(f, "rb").read())
If your project looks different than the default, that would be
noteworthy.