Ticket #9482: 9482-DJANGO_SETTINGS_MODULE-r9295.diff
File 9482-DJANGO_SETTINGS_MODULE-r9295.diff, 1018 bytes (added by , 16 years ago) |
---|
-
django/core/management/__init__.py
312 312 project_directory = os.getcwd() 313 313 project_name = os.path.basename(project_directory) 314 314 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 319 315 # Set DJANGO_SETTINGS_MODULE appropriately. 320 316 if original_settings_path: 321 317 os.environ['DJANGO_SETTINGS_MODULE'] = original_settings_path 322 318 else: 323 319 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() 324 323 return project_directory 325 324 326 325 def execute_from_command_line(argv=None):