コード例 #1
0
ファイル: testapp.py プロジェクト: 20tab/uwsgi
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()
コード例 #2
0
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()
コード例 #3
0
ファイル: testapp.py プロジェクト: 20tab/uwsgi
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)
コード例 #4
0
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)
コード例 #5
0
ファイル: testapp.py プロジェクト: 20tab/uwsgi
def gomako():
    from mako.template import Template
    uwsgi.start_response('200 OK', [('Content-Type', 'text/html')])
    yield Template("hello ${data}!").render(data="world")
コード例 #6
0
def gomako():
    from mako.template import Template
    uwsgi.start_response('200 OK', [('Content-Type', 'text/html')])
    yield Template("hello ${data}!").render(data="world")