﻿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
11633	Stop requiring DJANGO_SETTINGS_MODULE when using settings.configure	Masklinn	nobody	"Currently, django requires both that there is a {{{DJANGO_SETTINGS_MODULE}}} environment variable and that it points to an actual module, even though it's not necessary when calling {{{django.config.settings.configure}}}.

Therefore to use Django modules in standalone system (or when testing an application on its own without a project, as in #11593) one has to either create an empty settings file (which kind-of defeats the point of using {{{settings.configure}}} in the first place) or programmatically create a {{{DJANGO_SETTINGS_MODULE}}} environ set to a dummy module name and generate the corresponding dummy module in {{{settings.modules}}} e.g.

{{{
os.environ['DJANGO_SETTINGS_MODULE'] = ""durrrrr""
sys.modules['durrrrr'] = type('IMA_MODULE', (), {})()
from django.conf import settings
# call settings.configure() here
}}}

Now while this isn't exactly hard to do (if you understand how module imports work & everything), it's annoying to have to do it and it can conflict with other modules if the dummy name isn't correctly chosen. It's also a waste of time on the user's side."		closed	Core (Other)	dev		worksforme	settings		Accepted	0	0	0	0	0	0
