Changeset 448 in main


Ignore:
Timestamp:
11/04/11 09:19:30 (8 years ago)
Author:
pcosquer
Message:

manage.py: if an ImportError? is raised, print it. Reported by Jason Morgan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/manage.py

    r2 r448  
    11#!/usr/bin/python 
    22from django.core.management import execute_manager 
     3 
    34try: 
    45    import settings # Assumed to be in the same directory. 
    5 except ImportError: 
     6except ImportError as er: 
    67    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__) 
     8    # print 'er' in case of a missing module dependence 
     9    # reported by Jason Morgan 
     10    sys.stderr.write(str(er)) 
     11    sys.stderr.write("\nError: Can't find the file 'settings.py' in the directory\n") 
    812    sys.exit(1) 
     13 
    914 
    1015if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.