forked from kapsiry/sikteeri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdjango.wsgi.template
31 lines (22 loc) · 1020 Bytes
/
django.wsgi.template
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
27
28
29
30
#!/usr/bin/env python
import os, sys
# path is the parent directory of this script ('/var/www' in this case)
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# we check for path because we're told to at the tail end of
# http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIReloadMechanism
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'sikteeri.settings'
import logging
logger = logging.getLogger('')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler('/tmp/sikteeri.log')
raise Exception("django.wsgi not configured")
handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(name)-16s %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logging.getLogger('django.wsgi').info("sikteeri logging started, launching Django")
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()