【问题标题】:django-registration-redux and django-crispy-forms: submit button not respondingdjango-registration-redux 和 django-crispy-forms:提交按钮没有响应
【发布时间】:2018-02-16 04:27:48
【问题描述】:

我的registration_form.html是

{% extends '../base.html' %}
{% load crispy_forms_tags %}
{% block content %}
{% crispy form %}
<input type='submit' value="submit">
{% endblock %}

视图位于现有应用程序的模块中。如下:

from registration.views import RegistrationView
from . import forms

class MyRegistrationView(RegistrationView):
    def get_form_class(self):
        return forms.LoginForm

urls.py文件中的url是

url(r'^accounts/register/$',MyRegistrationView.as_view()),

当页面加载时,填写它,当我点击提交时,它没有提交。 请问我错过了什么?

【问题讨论】:

  • 注意你可以设置form_class = forms.LoginForm而不是定义get_form_class()

标签: django django-forms django-registration


【解决方案1】:

看起来好像您的表单没有包含在&lt;form&gt; 标记中。你应该有类似的东西:

<form method="post" action="">
    {% crispy form %}
    <input type='submit' value="submit">
</form>

【讨论】:

    猜你喜欢
    • 2015-08-29
    • 2014-02-10
    • 2017-07-08
    • 2021-09-22
    • 2015-02-19
    • 2013-02-07
    • 2012-04-25
    • 2018-07-22
    • 1970-01-01
    相关资源
    最近更新 更多