【问题标题】:Include urls for django-registration包含 django-registration 的 url
【发布时间】: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


    【解决方案1】:

    找出问题所在, 我在应用程序的 urls.py 中添加了 URL 模式,而不是根项目的。

    希望这也能帮助别人!

    【讨论】:

      猜你喜欢
      • 2012-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-09
      • 1970-01-01
      • 2011-05-16
      • 1970-01-01
      • 2012-04-11
      相关资源
      最近更新 更多