Created
December 14, 2010 17:12
-
-
Save lettertwo/740721 to your computer and use it in GitHub Desktop.
Detects which mode mod_wsgi is running in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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