Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (31 sloc) 1.3 KB
import os
import site
from datetime import datetime
os.environ["CELERY_LOADER"] = "django"
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"
# Remember when mod_wsgi loaded this file so we can track it in nagios.
wsgi_loaded =
# Add the main dir to the python path so we can import manage.
wsgidir = os.path.dirname(__file__)
site.addsitedir(os.path.abspath(os.path.join(wsgidir, '../')))
# manage adds /apps, /lib, and /vendor to the Python path.
import manage
import django.conf
import django.core.handlers.wsgi
import django.utils
# Do validate and activate translations like using `./ runserver`.
utility =
command = utility.fetch_command('runserver')
# This is what mod_wsgi runs.
django_app = django.core.handlers.wsgi.WSGIHandler()
def application(env, start_response):
env['wsgi.loaded'] = wsgi_loaded
return django_app(env, start_response)
# Uncomment this to figure out what's going on with the mod_wsgi environment.
# def application(env, start_response):
# start_response('200 OK', [('Content-Type', 'text/plain')])
# return '\n'.join('%r: %r' % item for item in sorted(env.items()))
# vim: ft=python
Jump to Line
Something went wrong with that request. Please try again.