Hi am a noob working with Apache, mod_wsgi and python.
Below is some sample code on the internet that will return "Hello World!" when i go to my local server:
note:
I do have
WSGIScriptAlias /py "C:/Users/user/site/handler.py"
in my httpd.conf
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
can anyone give me a run down of how this code works differently then if i were to just try to run the following the pyhton shell:
def main()
print "Hello World!"
return 0
My goal is to adapt some code that runs in the python shell to run on my server with the same function, but when I try to modify most things i get Internal Server Errors (ie: adding import cgi) or the link to the code breaks...