【问题标题】:Django - Context not available in template tag includeDjango - 模板标签中不可用的上下文包括
【发布时间】:2012-12-09 02:09:01
【问题描述】:
<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
   {{ form.subscription_year_plan }}
   <div class="page1"> {% include "account/signup_1.html" %} </div>
   <div class="page2"> {% include "account/signup_2.html" %} </div>
</form>

这是我的 html 的一部分。 {{ form.subscription_year_plan }}signup_1.html 的外部和内部可用,但在signup_2.html 内部不可用。

有什么问题?

【问题讨论】:

  • signup_2.html 中可能有错字。你能附上它的来源吗?
  • 知道了。我试图在 signup_2.html 中的 div 中使用 {{ form.subscription_year_plan }},该文件已准备好由 ajax 填充。
  • 您可以将其添加为答案然后接受它,这样问题就不会保持开放吗?

标签: jquery python django-forms django-templates django-context


【解决方案1】:

知道了。我试图在 signup_2.html 的 div 中使用 {{ form.subscription_year_plan }},该 div 正在由文档准备好的 ajax 填充。

【讨论】:

    猜你喜欢
    • 2021-07-26
    • 1970-01-01
    • 2020-04-12
    • 2017-04-29
    • 1970-01-01
    • 2010-10-25
    • 1970-01-01
    • 1970-01-01
    • 2013-04-02
    相关资源
    最近更新 更多