Skip to content

Instantly share code, notes, and snippets.

@simonw
Created May 27, 2010 13:18
Show Gist options
  • Select an option

  • Save simonw/415785 to your computer and use it in GitHub Desktop.

Select an option

Save simonw/415785 to your computer and use it in GitHub Desktop.
import django
from django.template import Template, Context
template_string = """
The answer to the Ultimate
Question is {{ everything.universe.answer }}.
Among our weapons are:
{% for weapon in weapons %}
{{ weapon }}
{% endfor %}
"""
class DjangoDemo:
name = 'django'
version = django.VERSION
def demo(self, vars):
template = Template(template_string)
return template.render(Context(vars))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment