Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Django SSI library for use with Nginx

Project description

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

  1. The template is cached in its raw unrendered form
  2. The template string’s md5 hash is used as a cache key
  3. The template’s context is stored with the cache key as a prefix
  4. A request to the SSI url looks up the template and the context in the cache, renders it and returns the HttpResponse

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_nginx_ssi-0.1.1-py2.6.egg (8.9 kB) Copy SHA256 hash SHA256 Egg 2.6 May 27, 2011
django-nginx-ssi-0.1.1.tar.gz (5.0 kB) Copy SHA256 hash SHA256 Source None May 27, 2011

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page