无法解析django中的提醒 [英] Could not parse the reminder in django

查看:343
本文介绍了无法解析django中的提醒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在jquery模板中添加脚本标签。所以我提到这个链接
它以下列方式告诉内部脚本标签:

I want to add a script tag inside a jquery template. So am referring to this link. It tells to close the inner script tag in the following way :

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

我尝试过,但django显示此错误:
无法解析余数: < / sc+ript'from'html< / sc+ript>'

I tried it, but django shows this error: Could not parse the remainder: '" < /sc"+"ript>"' from 'html "< /sc"+"ript>"'

。我如何做这个django。在这个django中有什么具体的解决方案吗?

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

推荐答案

{ } 是Django模板中的保留字符,因此您需要使用 templatetag

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

替换:

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

与:

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

这篇关于无法解析django中的提醒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆