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 | 75eba6fe02babf4a4e86997578e2caf9f7ba828e (patch) | |
tree | 251c730e3bfe366c66d495838a8dc0765003b627 /example_project/manage.py | |
parent | 938270b76b0526ba9bcb063a58a80d1a2e5796ec (diff) | |
download | Ishtar-75eba6fe02babf4a4e86997578e2caf9f7ba828e.tar.bz2 Ishtar-75eba6fe02babf4a4e86997578e2caf9f7ba828e.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) |