Skip to content

Instantly share code, notes, and snippets.

View jgorset's full-sized avatar

Johannes Gorset jgorset

View GitHub Profile
@jgorset
jgorset / gist:3378321
Created August 17, 2012 12:01
Side-by-side comparison of template tags in Django and Ruby on Rails

Side-by-side comparison of template tags in Django and Ruby on Rails

Format the current time

Django

from django import template
import datetime
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best