mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #15064 -- Made manage.py honor the existence and value of DJANGO_SETTINGS_MODULE env var. Thanks olau for the report and Shawn Milochik for a patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16222 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -411,7 +411,11 @@ def setup_environ(settings_mod, original_settings_path=None):
|
||||
if original_settings_path:
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = original_settings_path
|
||||
else:
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, settings_name)
|
||||
# If DJANGO_SETTINGS_MODULE is already set, use it.
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = os.environ.get(
|
||||
'DJANGO_SETTINGS_MODULE',
|
||||
'%s.%s' % (project_name, settings_name)
|
||||
)
|
||||
|
||||
# Import the project module. We add the parent directory to PYTHONPATH to
|
||||
# avoid some of the path errors new users can have.
|
||||
|
||||
Reference in New Issue
Block a user