Wsgi fix.
[fsij-members-webapp.git] / scripts / fsij-django.wsgi
1 import os
2 import sys
3
4 sys.path.append('/home/fsij/django')
5 os.environ['DJANGO_SETTINGS_MODULE'] = 'fsij.settings'
6
7 import django.core.handlers.wsgi
8
9 class MaintenanceHandler(object):
10    def __call__(self, environ, start_response):
11       status = '200 OK'
12       response_headers = [('Content-type','text/plain')]
13       start_response(status, response_headers)
14       return ['Maintenance time.  Please visit again.\n']
15
16 if os.path.exists('/home/fsij/django/fsij/stop_service'):
17    application = MaintenanceHandler()
18 else:
19    application = django.core.handlers.wsgi.WSGIHandler()