Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6384637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:48:01+00:00 2026-05-25T02:48:01+00:00

I need a javascript templating system and i think handlebars.js does an excellent job

  • 0

I need a javascript templating system and i think handlebars.js does an excellent job in this case.
I’m having syntax conflicts with handlebars templates inside a django template because django tries to render handlebars variables.

Is there a tag in django templates to stop rendering a block with curly braces?

Something like:

{{ django_context_varable }} #works
{{% raw %}}
<script id="restaurants-tpl" type="text/x-handlebars-template">
    <ul>
    {{#restaurants}} #not rendered by django, plain text
    <li>{{name}}</li>
    {{/restaurants}}
    </ul>
</script>
{{% endraw %}}

Edit

Likely i found this. It works fine.

Update

Django 1.5 supports verbatim tag natively.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:48:02+00:00Added an answer on May 25, 2026 at 2:48 am

    Is there a tag in django templates to stop rendering a block with curly braces?

    OLD Answer for Django 1.0-1.4: No, though you could though you could put the block in a separate file and include it without rendering or use a different templating engine.

    New Answer: The answer above was correct in August 2011 when the question was asked and answered. Starting in Django 1.5 (released Feb 2013, though alpha/beta versions in late 2012), they introduced the {% verbatim %} and {% endverbatim %} which will prevent the django template engine from processing the content in the block.

    So for the question asked the following will work in django 1.5+ out of the box:

    {{ django_context_varable }} #works
    {% verbatim %}
    <script id="restaurants-tpl" type="text/x-handlebars-template">
        <ul>
        {{#restaurants}} #not rendered by django, plain text
        <li>{{name}}</li>
        {{/restaurants}}
        </ul>
    </script>
    {% endverbatim %}
    

    The documentation on verbatim is here. Yes, this was noted by others earlier, but as this is the accepted answer I should list the easiest solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Javascript noob here (I'm assuming I will need Javascript to solve this). I need
So I've seen this post on JavaScript Micro-Templating by John Resig and I have
Situation: A PHP Templating system that is responsible for building a pages HTML. Javascript
When a user clicks on my green button, I need Javascript to detect this
Possible Duplicate: Why does the JavaScript need to start with “;” ? I've been
I need JavaScript working almost perfectly in my application that should be able to
I need a JavaScript library that supports Ajax as well as help me in
I need a Javascript application that, when run, prompts a password to be entered,
I need a javascript bookmark to take the url I have in the clipboard
I need the JavaScript code to iterate through the filled attributes in an HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.