Ticket #5943: 5943-django-admin-8295.diff

File 5943-django-admin-8295.diff, 974 bytes (added by Ivan Illarionov, 16 years ago)
  • django/core/management/__init__.py

     
    104104        # Find the project directory
    105105        try:
    106106            from django.conf import settings
    107             project_directory = setup_environ(__import__(settings.SETTINGS_MODULE))
     107            settings_mod = __import__(settings.SETTINGS_MODULE, {}, {},
     108                             [settings.SETTINGS_MODULE.split('.')[-1]])
     109            project_directory = setup_environ(settings_mod)
    108110        except (AttributeError, EnvironmentError, ImportError):
    109111            project_directory = None
    110112
     
    310312
    311313    # Set DJANGO_SETTINGS_MODULE appropriately.
    312314    os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, settings_name)
     315    return project_directory
    313316
    314317def execute_from_command_line(argv=None):
    315318    """
Back to Top