【发布时间】:2017-05-08 15:20:16
【问题描述】:
所以我刚刚安装了 django-registration 并从 https://github.com/macdhuibh/django-registration-templates 获得了模板
我遇到了 URL 解析器的问题,我明白了
使用参数“()”和关键字反转“auth_password_reset” 未找到参数“{}”。
还有很多其他的......
urls.py:
#Other stuff,
url(r'^accounts/', include('registration.backends.hmac.urls')),
完全按照文档指定。 此外,这里是引发错误的 html。它来自 github 的 login.html。这是引发此错误的错误,但似乎每次我尝试对来自 django-registration 的 auth_url.py 的 url 进行反向匹配时都会得到类似的结果。
{% extends "main/header.html" %}
{% load i18n %}
{% block content %}
<form method="post" action=".">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="{% trans 'Log in' %}" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
<p>{% trans "Forgot password" %}? <a href="{% url 'auth_password_reset' %}">{% trans "Reset it" %}</a>!</p>
<p>{% trans "Not member" %}? <a href="{% url 'registration_register' %}">{% trans "Register" %}</a>!</p>
{% endblock %}
提前致谢。
【问题讨论】:
标签: python django django-templates django-urls django-registration