close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 8 and Version 9 of RequestHandlers


Ignore:
Timestamp:
Jul 9, 2008, 10:07:38 AM (13 years ago)
Author:
cmlenz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RequestHandlers

    v8 v9  
    3939First, there's the `@output` decorator, which you use to specify the name of the template file, the serialization method, the response MIME type and encoding, and other serialization options such as the `DOCTYPE` to use and so on.
    4040
    41 Note that all of these are optional. For example, you can omit the template file name for a response that doesn't involve template rendering, and just use the `mimetype` and `encoding` options:
     41{{{
     42#!python
     43from diva.templating import output, render
     44
     45@output('index.html', method='html', doctype='html-strict')
     46def index(request, response):
     47    return render(message='Hello, world!')
     48}}}
     49
     50Note that all of the arguments to `@output` are optional. For example, you can omit the template file name for a response that doesn't involve template rendering, and just use the `mimetype` and `encoding` options:
    4251
    4352{{{