def goxml(): import xml.dom.minidom doc = xml.dom.minidom.Document() foo = doc.createElement("foo") doc.appendChild(foo) uwsgi.start_response('200 OK', [('Content-Type', 'text/xml')]) return doc.toxml()
def djangohomepage(): from django.template import Template, Context uwsgi.start_response('200 OK', [('Content-Type', 'text/html')]) t = Template("My name is {{ my_name }}.") c = Context({"my_name": "Serena"}) print t,c a = t.render(c) print "ciao", a yield str(a)
def djangohomepage(): from django.template import Template, Context uwsgi.start_response('200 OK', [('Content-Type', 'text/html')]) t = Template("My name is {{ my_name }}.") c = Context({"my_name": "Serena"}) print t, c a = t.render(c) print "ciao", a yield str(a)
def gomako(): from mako.template import Template uwsgi.start_response('200 OK', [('Content-Type', 'text/html')]) yield Template("hello ${data}!").render(data="world")