Code

Ticket #14130: trac-14130.diff

File trac-14130.diff, 1.1 KB (added by steph, 3 years ago)

Updated the patch and removed an unused import.

Line 
1diff --git a/django/conf/project_template/manage.py b/django/conf/project_template/manage.py
2index 5e78ea9..3e4eedc 100755
3--- a/django/conf/project_template/manage.py
4+++ b/django/conf/project_template/manage.py
5@@ -1,11 +1,14 @@
6 #!/usr/bin/env python
7 from django.core.management import execute_manager
8+import imp
9 try:
10-    import settings # Assumed to be in the same directory.
11+    imp.find_module('settings') # Assumed to be in the same directory.
12 except ImportError:
13     import sys
14-    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
15+    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
16     sys.exit(1)
17 
18+import settings
19+
20 if __name__ == "__main__":
21     execute_manager(settings)