Ticket #9482: 9482-DJANGO_SETTINGS_MODULE-r9295.diff

File 9482-DJANGO_SETTINGS_MODULE-r9295.diff, 1018 bytes (added by Tai Lee, 16 years ago)
  • django/core/management/__init__.py

     
    312312        project_directory = os.getcwd()
    313313    project_name = os.path.basename(project_directory)
    314314    settings_name = os.path.splitext(settings_filename)[0]
    315     sys.path.append(os.path.join(project_directory, os.pardir))
    316     project_module = __import__(project_name, {}, {}, [''])
    317     sys.path.pop()
    318 
    319315    # Set DJANGO_SETTINGS_MODULE appropriately.
    320316    if original_settings_path:
    321317        os.environ['DJANGO_SETTINGS_MODULE'] = original_settings_path
    322318    else:
    323319        os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, settings_name)
     320    sys.path.append(os.path.join(project_directory, os.pardir))
     321    project_module = __import__(project_name, {}, {}, [''])
     322    sys.path.pop()
    324323    return project_directory
    325324
    326325def execute_from_command_line(argv=None):
Back to Top