Ticket #13043: 13043__alternate_approach_with_more_info.patch

File 13043__alternate_approach_with_more_info.patch, 1.6 KB (added by Fred Palmer, 14 years ago)
  • manage.py

    diff --git a/manage.py b/manage.py
    index 5e78ea9..204f206 100644
    a b  
    11#!/usr/bin/env python
    2 from django.core.management import execute_manager
     2"""
     3This file is automatically created in each Django project.
     4It is a thin wrapper around django-admin.py
     5"""
     6import django.core.management
     7
    38try:
    49    import settings # Assumed to be in the same directory.
    5 except ImportError:
    6     import sys
    7     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__)
     10except ImportError, import_error:
     11    import sys, traceback
     12    sys.stderr.write("""
     13ERROR:
     14    Could not import the 'settings' module.
     15    The error was '%s'.  See the traceback below for the full error.
     16
     17TIPS:
     18    * Make sure the 'settings' module doesn't have any syntax errors
     19    * Make sure any import statements in the 'settings' module are valid
     20        (e.g. is the dependency in the python site-packages?)
     21    * Make sure the file 'settings.py' is in the directory containing %r.
     22        (If the file settings.py does indeed exist, it's causing an ImportError somehow.)
     23    * If you have customized things. You may have to run django-admin.py, passing it your settings module.
     24
     25""" % (import_error, __file__))
     26    traceback.print_exc()
    827    sys.exit(1)
    928
    1029if __name__ == "__main__":
    11     execute_manager(settings)
     30    django.core.management.execute_manager(settings)
Back to Top