- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 urls.py 中有这段代码:
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^accounts/', include('allauth.urls')),
url(r'^profile/', include('userProfile.urls')),
]
这是 userProfile.urls.py 文件:
from django.conf.urls import url, include
from django.contrib import admin
from .views import (
profile_user,
)
urlpatterns = [
url(r'^(?P<id>[0-9]+)/profile/$', profile_user),
]
我在/accounts/signup 上收到了这个错误 NoReverseMatch。我在某处读到问题一定是在 urls.py 文件中,但我不知道为什么,如果有人可以提供帮助,那就太好了。上次我检查时一切正常,现在出了点问题。谢谢。
我知道错误可能不够清楚,所以我从浏览器复制了整个错误:
NoReverseMatch at /accounts/login/
Reverse for 'index' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/login/
Django Version: 1.9.5
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'index' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Exception Location: C:\Python27\lib\site-packages\django\core\urlresolvers.py in _reverse_with_prefix, line 508
Python Executable: C:\Python27\python.exe
Python Version: 2.7.11
Python Path:
['D:\\Programiranje\\Python\\Projekat ISA\\ProjekatRestorani',
'C:\\WINDOWS\\SYSTEM32\\python27.zip',
'C:\\Python27\\DLLs',
'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk',
'C:\\Python27',
'C:\\Python27\\lib\\site-packages']
Server time: Thu, 19 May 2016 12:03:20 +0000
Error during template rendering
In template C:\Python27\lib\site-packages\allauth\templates\account\login.html, error at line 14
Reverse for 'index' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
4 {% load account socialaccount %}
5
6 {% block head_title %}{% trans "Sign In" %}{% endblock %}
7
8 {% block content %}
9
10 <h1>{% trans "Sign In" %}</h1>
11
12 {% get_providers as socialaccount_providers %}
13
14 {% if socialaccount_providers %}
15 <p>{% blocktrans with site.name as site_name %}Please sign in with one
16 of your existing third party accounts. Or, <a href="{{ signup_url }}">sign up</a>
17 for a {{ site_name }} account and sign in below:{% endblocktrans %}</p>
18
19 <div class="socialaccount_ballot">
20
21 <ul class="socialaccount_providers">
22 {% include "socialaccount/snippets/provider_list.html" with process="login" %}
23 </ul>
但这不是我的 login.html 代码...这是我的 login.html 文件中的代码:
{% extends "base.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 %}
因此,如果我从我的模板文件夹中删除文件,并让他为空,它就可以正常工作。我希望我现在给了你一些有用的信息。
最佳答案
问题可能出在您的 HTML 中。尝试通过添加 name='profile' 为该 url 命名空间。如果您有类似
的内容,请检查您的 HTMLhref="{% url 'YourApp:profile' %}"
您应该检查您的网址是否有反向匹配。
关于python - NoReverseMatch 在/accounts/signup/django-allauth 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37307456/
我正在使用带有 allauth 的 django 1.6。 我刚刚启用了电子邮件验证功能,正在寻找识别身份的最佳方法 用户是否拥有经过验证的电子邮件 . 我遇到并想问的一件有趣的事情:我注意到一个用户
我想对 django-allauth 中的字段进行一些额外的验证。例如,我想阻止使用免费电子邮件地址。所以我想在注册时运行这个方法 def clean_email(self): email_d
我一直在尝试寻找如何使用 django-allauth 向已经注册并登录的用户添加新的社交帐户。到目前为止,我找到了this question , 和 this other question与我需要的
我想扩展 django-allauth 以包含其他第三方 OAuth 提供商(例如、SurveyMonkey、Qualtrics 等)。我还没有找到关于如何扩展 django-allauth 的好教程
我已经创建了一个Django Web应用程序,我想使用allauth为GitHub创建一个SSO。。我已经设置好了,它运行得很好。但现在,所有GitHub用户都可以登录我的网络应用程序。我想将其仅限于
如何将 Google One Tap 登录体验与 django-allauth 集成? django-allauth 已集成并且非常适合简单的用户名/密码登录。 我有 Google OneTap 更好
我已经设置了 allauth 并注意到它暴露了 /accounts/password/change/这是更改当前登录用户密码的可爱形式。它还暴露了/accounts/email/这非常适合处理与将电子
在多个站点上使用时,是否可以将Django allauth的身份验证方法设置为“email”? 我的目标是允许电子邮件地址为bob@example.com的用户在site1.com上创建一个帐户,并在
我目前正在尝试实现 SendGrid,以便为注册的社交帐户用户发送确认电子邮件,我收到以下错误 SMTPDataError at /accounts/facebook/login/callback/
我正在使用 django-axes 将登录尝试限制在管理后端。但是,对于通过 django-allauth 登录的前端客户端,我找不到任何机制来检测和防止登录失败。 使用 allauth 防止多次登录
我正在使用此代码(在 forms.py 中)作为我的 allauth 自定义注册表单: class RegistrationForm(UserCreationForm): birth_date
我正在使用 django allauth 身份验证系统,我使用带有“next”参数的社交注册,如下所示: 其中 next 是一个动态变量。 但是,我想为该过程注入(inject)第二个屏幕,询问电话
django-allauth docs声称支持让用户与社交网络断开连接的工作流程,他们甚至涵盖了当用户成功断开帐户时发出的信号。 但是文档没有说明如何启动断开连接。当我列出 allauth 项目中的所
我是Django的新手,并且已经安装django-allauth。 我遵循了文档,但是在安装后的步骤中遇到了麻烦: Add a Site for your domain, matching setti
我找到了相反场景的答案: django-allauth: Linking multiple social accounts to a single user 即。本地用户可以在其中连接社交帐户。通过社
我一直按照说明为我的网站设置 django-allauth 软件包,一切正常,直到注册后发送确认电子邮件为止。一切似乎都工作正常,因为我注册了并且有关新帐户的信息位于数据库中(user 表和 acco
我的系统中有两种类型的用户,我想在注册时分配适当的组。引用How to customize user profile when using django-allauth ,我想我可以覆盖注册表单并执行
我尝试关注最新的http://django-allauth.readthedocs.org/en/latest/#installation urls.py 文件如下所示: urlpatterns =
我正在利用 django-allauth 为我的属性(property)管理应用程序提供 Google 身份验证。这是我正在寻找的注册工作流程: A new manager goes to a reg
我主要使用 django-allauth 作为为管理后端创建用户帐户的方式。我希望发生的是: 1) 当用户完成注册过程时,发送验证电子邮件(到目前为止我已经这样做了)并将用户设置为非事件、员工,并通过
我是一名优秀的程序员,十分优秀!