Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#6493 closed (wontfix)

Don't clobber a set DJANGO_SETTINGS_MODULE

Reported by: Bastian Kleineidam <calvin@…> 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)

0029-Don-t-clobber-a-set-DJANGO_SETTINGS_MODULE.patch (992 bytes ) - added by Bastian Kleineidam <calvin@…> 17 years ago.

Download all attachments as: .zip

Change History (3)

by Bastian Kleineidam <calvin@…>, 17 years ago

comment:1 by Malcolm Tredinnick, 17 years ago

Resolution: wontfix
Status: newclosed

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.

comment:2 by Bastian Kleineidam <calvin@…>, 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.
Back to Top