1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 import sys
27 import logging
28
29 from django.core.management import execute_manager
30
31 logger = logging.getLogger(__name__)
32
33 try:
34 import settings
35 except ImportError:
36 logger.error("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__)
37 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__)
38 sys.exit(1)
39
40 if __name__ == "__main__":
41 from omero.util import configure_logging
42 if settings.DEBUG:
43 configure_logging(settings.LOGDIR, 'OMEROweb.log', loglevel=logging.DEBUG)
44
45 logger.info("Application Starting...")
46 execute_manager(settings)
47