diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-14 19:37:35 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-14 19:37:35 +0200 |
commit | 11185161a0ec5c15a1852fd7bc387b82573b577a (patch) | |
tree | 251c730e3bfe366c66d495838a8dc0765003b627 /example_project/manage.py | |
parent | c689207628c6034f6ca2ff8dfdadf1bedd9915f6 (diff) | |
download | Ishtar-11185161a0ec5c15a1852fd7bc387b82573b577a.tar.bz2 Ishtar-11185161a0ec5c15a1852fd7bc387b82573b577a.zip |
Django 1.8: fix import errors, deprecation warnings and models warnings
Diffstat (limited to 'example_project/manage.py')
-rwxr-xr-x | example_project/manage.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/example_project/manage.py b/example_project/manage.py index 4981a4830..80114eb68 100755 --- a/example_project/manage.py +++ b/example_project/manage.py @@ -1,15 +1,12 @@ #!/usr/bin/env python -from django.core.management import execute_manager -import os, sys +import os +import sys sys.path.append(os.path.abspath('..')) -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) - if __name__ == "__main__": - execute_manager(settings) + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) |