|
|
|
@@ -0,0 +1,23 @@ |
|
|
|
#!/usr/bin/python |
|
|
|
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*- |
|
|
|
|
|
|
|
from decorators import WSGITemplate # decoratore ( singleton ) |
|
|
|
from decorators import WSGISimpleAuth # decoratore ( singleton ) |
|
|
|
|
|
|
|
|
|
|
|
wsgitmpl = WSGITemplate() |
|
|
|
wsgiauth = WSGISimpleAuth() |
|
|
|
|
|
|
|
# |
|
|
|
# esempio minimo di controller WSGI |
|
|
|
# |
|
|
|
@wsgiauth.auth() |
|
|
|
@wsgitmpl.template() |
|
|
|
def application( environ, start_response ): |
|
|
|
from pprint import pformat |
|
|
|
|
|
|
|
html = environ['template']( context=dict( v1=1, v2='pippo') ) |
|
|
|
|
|
|
|
start_response( '200 OK', [('content-type', 'text/html; charset=utf-8')] ) |
|
|
|
|
|
|
|
return [ html ] |