﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
15064	DJANGO_SETTINGS_MODULE doesn't work with runserver	Ole Laursen	ShawnMilo	"The help for --settings claims that one can use DJANGO_SETTINGS_MODULE to specify the settings module as an alternative to --settings. This seems to be wrong on two accounts, first it works even without a DJANGO_SETTINGS_MODULE (since it guesses settings.py), second setting DJANGO_SETTINGS_MODULE doesn't seem to have any effect at all with runserver.

If I try ""DJANGO_SETTINGS_MODULE=alternative_settings python manage.py runserver"" with a print in alternative_settings.py, I never get the print. The culprit seems to be setup_environ in django.core.__init__.py:
{{{
    # Set DJANGO_SETTINGS_MODULE appropriately.
    if original_settings_path:
        os.environ['DJANGO_SETTINGS_MODULE'] = original_settings_path
    else:
        os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, settings_name)
}}}
This always overwrites the environment variable; if I delete those lines, my alternative_settings.py are imported. I guess the correct fix is checking that DJANGO_SETTINGS_MODULE isn't set before overwriting it."	Bug	closed	Core (Management commands)	1.3	Normal	fixed		gordl dougal85@… luc.saffre@…	Accepted	1	0	0	0	1	0
