lib/handler.py
author Tero Marttila <terom@fixme.fi>
Fri, 06 Feb 2009 21:31:02 +0200
changeset 7 d6a8258bd90e
child 8 0ce1f471e9d7
permissions -rw-r--r--
YES YES MOAR WSGI - Hello World
7
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
"""
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     2
    The actual application behaviour, i.e. generating a Response from a Request :)
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
"""
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     5
import http, page
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     6
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     7
def handle_request (request) :
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     8
    """
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     9
        Take the Request, and return a Response
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    10
    """
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    11
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    12
    return http.Response("Hello World")
d6a8258bd90e YES YES MOAR WSGI - Hello World
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    13