Code

Ticket #6102: setup_environ.diff

File setup_environ.diff, 781 bytes (added by erob, 7 years ago)

initial revision

Line 
1Index: __init__.py
2===================================================================
3--- __init__.py (revision 6834)
4+++ __init__.py (working copy)
5@@ -260,9 +260,12 @@
6     project_module = __import__(project_name, {}, {}, [''])
7     sys.path.pop()
8 
9-    # Set DJANGO_SETTINGS_MODULE appropriately.
10-    os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name,
11-                                                      settings_name)
12+    if not os.environ.has_key('DJANGO_SETTINGS_MODULE'):
13+        # Set DJANGO_SETTINGS_MODULE appropriately, but don't enforce it
14+        # if it's already defined.
15+        os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, settings_name)
16+   
17+
18     return project_directory
19 
20 def execute_from_command_line(argv=None):