How do I use django templates tags with jquery template tags (link) without creating any conflicts? Both use {{ }} for marking tags. Does Django 1.3 have something to deal with this kind of issue? Real examples would be truly appreciated.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The built-in solutions in django that can help with this somewhat are
The templatetag tag with:
Whenever you need to use {{ or }} in your javascript which unfortunately will severely impact the readability of your code.
Alternatively if your javascript is static, then putting it in a separate file and including it with {% ssi %} without parsing it as a template would prevent conflicts.
There’s no really clean way to escape template tags in django templates that I know of.