Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

23 righe
588 B

  1. #!/usr/bin/python
  2. # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*-
  3. from decorators import WSGITemplate # decoratore ( singleton )
  4. from decorators import WSGISimpleAuth # decoratore ( singleton )
  5. wsgitmpl = WSGITemplate()
  6. wsgiauth = WSGISimpleAuth()
  7. #
  8. # esempio minimo di controller WSGI
  9. #
  10. @wsgiauth.auth()
  11. @wsgitmpl.template()
  12. def application( environ, start_response ):
  13. from pprint import pformat
  14. html = environ['template']( context=dict( v1=1, v2='pippo') )
  15. start_response( '200 OK', [('content-type', 'text/html; charset=utf-8')] )
  16. return [ html ]