#6493 closed (wontfix)
Don't clobber a set DJANGO_SETTINGS_MODULE
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Only set the DJANGO_SETTINGS_MODULE value if it is not already set.
Attachments (1)
Change History (3)
by , 17 years ago
Attachment: | 0029-Don-t-clobber-a-set-DJANGO_SETTINGS_MODULE.patch added |
---|
comment:1 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 17 years ago
Hm, I remember dimly having some problems without the patch. I will try to reproduce them and report back.
Note:
See TracTickets
for help on using tickets.
No, this is not a good idea. The environment variable is only set for the process space of the running Python process, so it doesn't affect anything outside the current Django process (and potentially its children). However, if we're using a particular settings value, then it should always be consistent -- whether somebody accesses it via DJANGO_SETTINGS_MODULE or tries to work it out as we do in the management command.
Thus, the current code makes sure that a consistent settings value is used throughout the process, which reduces the possibility of inadvertent errors.
If you have a concrete case where this is causing a bug then, please provide some details, however, the current code is there for a reason.