= Request Handlers = A request handler is a neutral name for what some other frameworks call “controllers” or “views”. It is simply a Python function that accepts the request and response objects as parameters, and returns a response. {{{ #!python from diva.templating import output, render @output('index.html') def index(request, response): return render(message='Hello, world!') }}} This defines a function called `index` that will respond to requests by rendering the template `index.html`. == URL Parts as Parameters == Any dynamic parts of the URLs defined in the UrlRouting are passed to the request handler as additional parameters. For example: {{{ #!python from datetime import datetime from diva import app from diva.templating import output, render @output('index.html') def monthly(request, response, year, month): return render(month=datetime(year, month, 1)) app.routing.add('/archives/{year:\d+}/{month:\d+}/', monthly) }}} Note that in this particular case, the values for `year` and `month` are automatically converted to numbers, due to the use of the `\d+` pattern in the route path.