# HG changeset patch # User Brian Neal # Date 1245619609 0 # Node ID 6dfcbbf112436f334724ea6e745ff5aee238e160 # Parent 0140ff687d49d2a8efaccd04147bdad8145ec216 Added a .wsgi file and an offline.html file. diff -r 0140ff687d49 -r 6dfcbbf11243 gpp/apache/sg101.wsgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/apache/sg101.wsgi Sun Jun 21 21:26:49 2009 +0000 @@ -0,0 +1,40 @@ +import os +import sys + +OFFLINE = True + +sys.path.append('/home/var/django-sites/sg101/django') +sys.path.append('/home/var/django-sites/sg101/3rdparty') +sys.path.append('/home/var/django-sites/sg101/sg101-trunk') +sys.path.append('/home/var/django-sites/sg101/sg101-trunk/gpp') + +os.environ['PYTHON_EGG_CACHE'] = '/home/var/django-sites/sg101/eggs/' + + +def offline_handler(environ, start_response): + wsgi_dir = os.path.dirname(__file__) + sys.path.append(project_dir) + + offline_file = os.path.join(wsgi_dir, '..', 'templates', 'offline.html') + if os.path.exists(offline_file): + response_headers = [('Content-type','text/html')] + response = open(offline_file).read() + else: + response_headers = [('Content-type','text/plain')] + response = 'SG101 website maintenance in progress; please check back soon.' + + if environ['REQUEST_METHOD'] == 'GET': + status = '503 Service Unavailable' + else: + status = '405 Method Not Allowed' + start_response(status, response_headers) + return [response] + + +if not OFFLINE: + os.environ['DJANGO_SETTINGS_MODULE'] = 'gpp.settings' + import django.core.handlers.wsgi + application = django.core.handlers.wsgi.WSGIHandler() +else: + application = offline_handler + diff -r 0140ff687d49 -r 6dfcbbf11243 gpp/templates/offline.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/templates/offline.html Sun Jun 21 21:26:49 2009 +0000 @@ -0,0 +1,15 @@ + + + +SurfGuitar101.com Currently Offline + + + + +

SurfGuitar101.com is Offline

+

+ We are currently undergoing site maintenance and hope to be back soon. Please check back later. +

+ +