Ticket #4436: django_manage.patch
File django_manage.patch, 2.7 KB (added by , 17 years ago) |
---|
-
home/eta/workspace/django_svn/django/conf/project_template/manage.py
1 1 #!/usr/bin/env python 2 2 from django.core.management import execute_manager 3 3 try: 4 import settings # Assumed to be in the same directory. 4 import os 5 settings_module = os.environ.get('DJANGO_SETTINGS_MODULE', 'settings') 6 settings = __import__(settings_module, {}, {}, ['']) 5 7 except ImportError: 6 8 import sys 7 9 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__) -
home/eta/workspace/django_svn/docs/django-admin.txt
7 7 8 8 In addition, ``manage.py`` is automatically created in each Django project. 9 9 ``manage.py`` is a thin wrapper around ``django-admin.py`` that takes care of 10 two thingsfor you before delegating to ``django-admin.py``:10 one thing for you before delegating to ``django-admin.py``: 11 11 12 12 * It puts your project's package on ``sys.path``. 13 13 14 * It sets the ``DJANGO_SETTINGS_MODULE`` environment variable so that it15 points to your project's ``settings.py`` file.16 17 14 The ``django-admin.py`` script should be on your system path if you installed 18 15 Django via its ``setup.py`` utility. If it's not on your path, you can find it in 19 16 ``site-packages/django/bin`` within your Python installation. Consider -
home/eta/workspace/django_svn/examples/manage.py
1 1 #!/usr/bin/env python 2 2 from django.core.management import execute_manager 3 3 try: 4 import settings # Assumed to be in the same directory. 4 import os 5 settings_module = os.environ.get('DJANGO_SETTINGS_MODULE', 'settings') 6 settings = __import__(settings_module, {}, {}, ['']) 5 7 except ImportError: 6 8 import sys 7 9 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__)