diff -r d6a8258bd90e -r 0ce1f471e9d7 lib/handler.py --- a/lib/handler.py Fri Feb 06 21:31:02 2009 +0200 +++ b/lib/handler.py Fri Feb 06 22:48:00 2009 +0200 @@ -2,12 +2,26 @@ The actual application behaviour, i.e. generating a Response from a Request :) """ -import http, page +import http, page, template def handle_request (request) : """ Take the Request, and return a Response """ - return http.Response("Hello World") + # determine the page name + page_name = request.get_page_name() + # get the page handler + p = page.lookup(page_name) + + # render the template + response_data = template.render("layout", + site_root_url = request.get_script_dir(), + page_title = p.get_title(), + page_content = p.get_content(), + ) + + # return the response + return http.Response(response_data) +