Ticket #5825: user_commands_path.patch
File user_commands_path.patch, 1.4 KB (added by , 17 years ago) |
---|
-
django/core/management/__init__.py
87 87 except (AttributeError, EnvironmentError): 88 88 apps = [] 89 89 90 # Try to determine the project directory 91 try: 92 from django.conf import settings 93 project_directory = setup_environ(__import__(settings.SETTINGS_MODULE)) 94 except (AttributeError, EnvironmentError, ImportError): 95 project_directory = None 96 97 # Add the parent directory of the project directory to sys.path 98 # so we can find the management modules. 99 sys.path.append(os.path.join(project_directory, os.pardir)) 100 90 101 for app_name in apps: 91 102 try: 92 103 path = find_management_module(app_name) … … 95 106 except ImportError: 96 107 pass # No management module - ignore this app 97 108 98 # Try to determine the project directory 99 try: 100 from django.conf import settings 101 project_directory = setup_environ(__import__(settings.SETTINGS_MODULE)) 102 except (AttributeError, EnvironmentError, ImportError): 103 project_directory = None 109 sys.path.pop() 104 110 105 111 if project_directory: 106 112 # Remove the "startproject" command from self.commands, because