Ticket #2299: manage-settings.diff
File manage-settings.diff, 1.4 KB (added by , 18 years ago) |
---|
-
django/conf/project_template/manage.py
8 8 sys.exit(1) 9 9 10 10 if __name__ == "__main__": 11 execute_manager(settings) 11 import os 12 path = os.path.normpath(os.path.join(os.getcwd(), __file__)) 13 execute_manager(settings, path) -
django/core/management.py
1228 1228 if action not in NO_SQL_TRANSACTION: 1229 1229 print style.SQL_KEYWORD("COMMIT;") 1230 1230 1231 def execute_manager(settings_mod, argv=None):1231 def execute_manager(settings_mod, manage_file, argv=None): 1232 1232 # Add this project to sys.path so that it's importable in the conventional 1233 1233 # way. For example, if this file (manage.py) lives in a directory 1234 1234 # "myproject", this code would add "/path/to/myproject" to sys.path. 1235 project_directory = os.path.dirname(settings_mod.__file__) 1235 project_directory = os.path.dirname(manage_file) 1236 1236 1237 project_name = os.path.basename(project_directory) 1237 1238 sys.path.append(os.path.join(project_directory, '..')) 1238 1239 project_module = __import__(project_name, '', '', [''])