Skip to content

Instantly share code, notes, and snippets.

@lettertwo
Created December 14, 2010 17:12
Show Gist options
  • Save lettertwo/740721 to your computer and use it in GitHub Desktop.
Save lettertwo/740721 to your computer and use it in GitHub Desktop.
Detects which mode mod_wsgi is running in
# Detect which mode the wsgi module is in.
# Uncomment this to see whether or not the wsgi module is in daemon mode, which is necessary for the monitor.
def application(environ, start_response):
status = '200 OK'
if not environ['mod_wsgi.process_group']:
output = 'EMBEDDED MODE'
else:
output = 'DAEMON MODE'
response_headers = [('Content-Type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment