Failed to parse django reminder

I want to add a script tag inside a jquery template. Therefore, I refer to the link. It reports closing the internal script tag as follows:

<script id="filaVideoTemplate" type="text/x-jQuery-tmpl">
    <!-- Some HTML here -->
    <script type="text/javascript">
    <!-- Some javascript here -->
    {{html "</sc"+"ript>"}}
</script>

I tried, but django shows this error: Unable to parse the rest: '"</ sc" + "ript>"' from 'html "</ sc" + "ript>"'

. How can I do this django. Is there any specific solution in django for this?

+2
source share
1 answer

{and }are reserved characters in Django templates, so you need to use templatetag.

Replace:

{{html "</sc"+"ript>"}}

WITH

{% templatetag openbrace %}{% templatetag openbrace %}html "</sc"+"ript>"{% templatetag closebrace %}{% templatetag closebrace %}
+2
source

All Articles