public
Description: Turtles all the way down
Homepage: http://simonwillison.net/2009/May/19/djng/
Clone URL: git://github.com/simonw/djng.git
djng / example_template.py
100644 14 lines (10 sloc) 0.32 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import djng, os, datetime
 
djng.template.configure(
    os.path.join(os.path.dirname(__file__), 'example_templates')
)
 
def index(request):
    return djng.TemplateResponse(request, 'example.html', {
        'time': str(datetime.datetime.now()),
    })
 
if __name__ == '__main__':
    djng.serve(index, '0.0.0.0', 8888)