﻿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
28752	django.setup() should be idempotent	pascal chambon	nobody	"Calling django.setup() multiple times is useless, BUT it can happen in lots of cases, that's why imho this case should be handled by the framework to avoid nasty side effects.

These ""duplicate calls"" often involve the collision between manage.py commands, tests, custom scripts, and external launchers like pytest-django. Plus maybe some corner cases when unittest-style TestCases and pytest-style test functions are mixed in the same project. 

Users have to do a real gym to call setup() ""at some moment"" in all these use cases, yet try to prevent multiple calls of this initialization step (like the 'if__name__ == ""main""' protection). So far my only way out was often to check for (not really undocumented) states of the framework before calling setup().

"	Bug	new	Core (Other)	1.11	Normal				Unreviewed	0	0	0	0	0	0
