manage.py: upgrade control scripts for Django 1.4

This commit is contained in:
Benjamin Dauvergne 2013-05-22 10:54:38 +02:00
parent 3a6bb4f34b
commit b90b15f445
2 changed files with 12 additions and 26 deletions

View File

@ -1,16 +1,9 @@
#!/usr/bin/env python
from django.core.management import execute_manager
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'appli_project.settings.dev'
try:
import appli_project.settings.dev as settings
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" % __file__)
sys.exit(1)
import os, sys
if __name__ == "__main__":
execute_manager(settings)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "appli_project.settings.dev")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

View File

@ -1,16 +1,9 @@
#!/usr/bin/env python
from django.core.management import execute_manager
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'appli_project.settings.prod'
try:
import appli_project.settings.dev as settings
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" % __file__)
sys.exit(1)
import os, sys
if __name__ == "__main__":
execute_manager(settings)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "appli_project.settings.prod")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)