Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up more fertilizer

  • Loading branch information...
commit 4c820caafe2bbc1eac6fa3a22f9703d9948c42a5 1 parent 7a98ced
@emesik authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 manage.py
View
15 manage.py
@@ -1,11 +1,14 @@
#!/usr/bin/env python
-from django.core.management import execute_manager
+import os
+from django.core.management import setup_environ, ManagementUtility
try:
- import settings # Assumed to be in the same directory.
+ import settings # Assumed to be in the same directory.
except ImportError:
- import sys
- 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__)
- sys.exit(1)
+ import sys
+ 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__)
+ sys.exit(1)
if __name__ == "__main__":
- execute_manager(settings)
+ setup_environ(settings, original_settings_path=os.environ.get('DJANGO_SETTINGS_MODULE', 'settings'))
+ utility = ManagementUtility(None)
+ utility.execute()
Please sign in to comment.
Something went wrong with that request. Please try again.