13👍
Use the templatetag
template tag to render the brackets:
{% templatetag openvariable %}each(i,cond) conditions.data{% templatetag closevariable %}
It’s a bit fiddly, which is why a raw
template tag has been proposed for Django 1.3.
2👍
There are a few solutions mentioned here:
https://github.com/nje/jquery-tmpl/issues#issue/17 – Edit: Old repo
https://github.com/jquery/jquery-tmpl/issues/#issue/74
My favorite is the {% verbatim %}
template tag that allows you to build jQuery templates from within Django ones.
- [Django]-Add inline model to django admin site
- [Django]-How do I install psycopg2 for Python 3.x?
- [Django]-Uninstall Django completely
0👍
I’m using Django 1.3 and adding
{% raw %} this should be ignored by django's template framework {% endraw %}
to my html file.
The server returns with a:
Invalid block tag: ‘raw’
Also in the docs I can’t seem to locate information about this tag you’re talking about.
https://docs.djangoproject.com/en/1.3/ref/templates/builtins/
- [Django]-How can I access environment variables directly in a Django template?
- [Django]-Annotate a queryset with the average date difference? (django)
- [Django]-How to add new languages into Django? My language "Uyghur" or "Uighur" is not supported in Django
0👍
There’s great information here on using Django templates, using icanhaz, but I think this is similar enough to JQuery templates.
http://tothinkornottothink.com/post/4282971041/using-jquery-templating-icanhaz-js-with-django
- [Django]-How to serve media files on Django production environment?
- [Django]-How about having a SingletonModel in Django?
- [Django]-Resource temporarily unavailable using uwsgi + nginx
0👍
I’ve found defaults to be useful if no ‘verbatim’ tag is supported.
Looks like this:
{{ some_undefined_variable|default: '....here goes the subject template....'}}
PS. Note for users of ChicagoBoss, which has no support for ‘verbatim’ tag in ErlyDTL.
- [Django]-Django: Open uploaded file while still in memory; In the Form Clean method?
- [Django]-How to add new languages into Django? My language "Uyghur" or "Uighur" is not supported in Django
- [Django]-Equivalent of PHP "echo something; exit();" with Python/Django?