aboutsummaryrefslogtreecommitdiffstats
path: root/example/manage.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-14 14:30:18 -0700
committerAymeric Augustin2013-10-14 14:30:18 -0700
commit188682a4bbb06e1181d30d624ec37f727e8f6a5e (patch)
tree7226ed441ddc5b849432637fb08a0ca9d5995122 /example/manage.py
parent87c314de8ff024d17b0a8eebb853e203e375fc12 (diff)
parent1af4317555c3c1d622f8811bf9b1517d409bfb55 (diff)
downloaddjango-debug-toolbar-188682a4bbb06e1181d30d624ec37f727e8f6a5e.tar.bz2
Merge pull request #408 from aaugustin/modernize-example-project
Modernize example project. Fix #406.
Diffstat (limited to 'example/manage.py')
-rwxr-xr-xexample/manage.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/example/manage.py b/example/manage.py
index 5e78ea9..2605e37 100755
--- a/example/manage.py
+++ b/example/manage.py
@@ -1,11 +1,10 @@
#!/usr/bin/env python
-from django.core.management import execute_manager
-try:
- 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 os
+import sys
if __name__ == "__main__":
- execute_manager(settings)
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv)