Ticket #6102: setup_environ.diff

File setup_environ.diff, 781 bytes (added by Etienne Robillard, 17 years ago)

initial revision

  • __init__.py

     
    260260    project_module = __import__(project_name, {}, {}, [''])
    261261    sys.path.pop()
    262262
    263     # Set DJANGO_SETTINGS_MODULE appropriately.
    264     os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name,
    265                                                       settings_name)
     263    if not os.environ.has_key('DJANGO_SETTINGS_MODULE'):
     264        # Set DJANGO_SETTINGS_MODULE appropriately, but don't enforce it
     265        # if it's already defined.
     266        os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, settings_name)
     267   
     268
    266269    return project_directory
    267270
    268271def execute_from_command_line(argv=None):
Back to Top