So far, I have set up mod_wsgi on Ubuntu server.
Then, I got the famous hello world example working.
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]
So when the request comes at http:///
I get a page saying “Hello World!”
But I am stuck here and trying to figure out the next step.
Now, what I would like to do is for example, when
the request comes for
http://<ipaddress>/
http://<ipaddress>/create
http://<ipaddress>/index
I would like to let other classes answer depending on this request.
Just like in GAE, in main.py you can have something like
application = webapp.WSGIApplication[
('/', Top),
('/create',Create),
('/index', Index), ]
Can someone guide me so that I can implement something like this?
Thank you for your help in advance.
Does anyone have eer implemented wsgi?
Should I just look into other frameworks source code?
Does anyone have eer implemented wsgi? Should I just look into other frameworks source code?
In broad terms you need to check the environment that’s been passed to you and process the URL related elements through a URL dispatch system of your creation.
Or you use an existing framework.
For a couple of purposes, I’ve considered writing WSGI directly, but so far for convenience’s sake I’ve always used a framework.