django-nginx-ssi 0.1.1
Django SSI library for use with Nginx
See http://wiki.nginx.org/HttpSsiModule
{% load nginxssi_tags %}
hello
{% nginxssi %}
<b> okidoki </b> {%now "jS F Y H:i"%} Hello {{foo}}
{% endnginxssi %}
world
Renders inline as:
hello <!--# include virtual="/nginxssi/a3e5fa678243e0bab620fbca75f6601d/" --> world
A request to /nginxssi/a3e5fa678243e0bab620fbca75f6601d/ renders:
<b> okidoki </b> 25th January 2011 13:26 Hello bar
Nginx will stitch these two together to form:
hello <b> okidoki </b> 25th January 2011 13:26 Hello bar world
How it works
- The template is cached in its raw unrendered form
- The template string's md5 hash is used as a cache key
- The template's context is stored with the cache key as a prefix
- A request to the SSI url looks up the template and the context in the cache, renders it and returns the HttpResponse
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| django-nginx-ssi-0.1.1.tar.gz (md5) | Source | 2011-05-27 | 4KB | 283 | |
| django_nginx_ssi-0.1.1-py2.6.egg (md5) | Python Egg | 2.6 | 2011-05-27 | 8KB | 289 |
- Author: Simon de Haan
- Home Page: http://github.com/smn/django-nginx-ssi
- License: BSD
- Categories
- Package Index Owner: smn
- DOAP record: django-nginx-ssi-0.1.1.xml
