django形式无

发布于 2025-02-11 05:13:11 字数 867 浏览 0 评论 0原文

我正在调查DJANGO框架,现在尝试创建重置密码的自定义过程。

我在模板中使用此URL路径

path('password_reset_confirm/<uidb64>/<token>', 
        PasswordResetConfirmView.as_view(
            template_name='user_account/reset_password/password_reset_confirm.html',
            success_url='/account/password_reset_complete/'),
        name="password_reset_confirm"),

,我使用酥脆的形式

<form class="login-form p-4 rounded" method="post">
   {% csrf_token %}
  <h1 class="h4 mb-4 font-weight-bold">Change your password</h1>
      <p>Use the form below to change your password.</p>

       {{ form|crispy }}

 <button type="submit" value="Change">
    Submit
 </button>
</form>

,因此此表单不在模板中显示,如果类型{{form}}而不是{{form.as_p}}或脆皮形式,则显示我 none none 在形式的位置。

Im on investigation Django framework and now trying to create custom procedure of resetting password.

I use this URL path

path('password_reset_confirm/<uidb64>/<token>', 
        PasswordResetConfirmView.as_view(
            template_name='user_account/reset_password/password_reset_confirm.html',
            success_url='/account/password_reset_complete/'),
        name="password_reset_confirm"),

In template i use crispy form

<form class="login-form p-4 rounded" method="post">
   {% csrf_token %}
  <h1 class="h4 mb-4 font-weight-bold">Change your password</h1>
      <p>Use the form below to change your password.</p>

       {{ form|crispy }}

 <button type="submit" value="Change">
    Submit
 </button>
</form>

So now this form do not showing in template, and if if type {{ form }} instead of {{ form.as_p }} or crispy form, that showing me None in form place.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文