如何将登录页面的Allauth模板编辑/修复到Django 1.8?
我一直在读关于导游的书,但我找不到任何解决这个问题的人。
这是我的settings.py
"""
Django settings for colectr project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings
我遵循使用django-allauth的说明,如所示。我不感兴趣使用社会认证-只是一个简单的电子邮件和密码注册流程。由于某种原因,当我去/accounts/login/时,我得到了错误
TemplateSyntaxError at /accounts/login/
'socialaccount' is not a registered tag library. Must be one of:
account
account_tags
...
在我的settings.py里
TEMPLATES = [
{
'BACKEND': &
我已经创建了一个可以工作的Django应用程序。我正在使用django-allauth来实现社交帐户身份验证。
现在,假设我使用一个没有人员访问权限的电子邮件id登录到我的应用程序中,如果我直接打开管理员登录页面,管理员登录页面将显示如下:
我的问题是:如何才能阻止Django显示消息"Successfully in as ... "?此消息的来源在哪里?
我使用Django all auth实现密码重置功能,但我想定制密码重置模板,下面是我的urls:
urls.py
from django.conf.urls import url,include
from django.urls import path
from rest_framework_jwt.views import obtain_jwt_token,refresh_jwt_token
from . import views
# Registration,Login,Forgot,Profile change
urlpatterns=[
url(r'^acco
当我加上:
'django.contrib.messages.context_processors.messages',
'allauth.account.context_processors.account',
'allauth.socialaccount.context_processors.socialaccount',
在模板中设置settings.py,同时配置教程中给出的allauth。我得到以下错误:
ImportError at /admin/
No module named context_processors
Request
我是django和im的新手,试图使用django allauth设置登录和注册页面。在各种教程的帮助下,我成功地做到了使用。然而,我想自定义我的登录页面,但同时我继续使用allauth代码。使用这个的答案,我已经取得了一些进展,但我仍然无法在模板上显示任何表单字段。基本上,我正在寻找对上述问题的代码的解释,但其中一个问题是为了帮助初学者。
这是我目前拥有的代码:
My views.py
from django.shortcuts import render
from django.http import HttpResponse
from .forms import nibit_login
是否可以使用allauth创建用户帐户,使用电子邮件作为用户名,而不使用其他详细信息,如密码?这样做的目的是让注册过程尽可能简单。是否可以在注册时跳过密码,并在确认电子邮件时更新密码?我已经在python shell (./manage.py shell)中尝试了这个场景,并获得了成功的输出。
In [1]: from django.contrib.auth.models import User
In [2]: User.objects.create(username='nopass')
Out[2]: <User: nopass>
In [3]: User.o
我使用django炊具来初始化我的项目。我使用sendgrid_backend.SendgridBackend作为我的电子邮件后端。我现在可以用sendgrid发送电子邮件,但是我想使用我的sendgrid模板,而不是django allauth提供的模板。
这是allauth提供的adapters.py
from typing import Any
from allauth.account.adapter import DefaultAccountAdapter
from allauth.socialaccount.adapter import DefaultSocialAccountAda
我使用来处理django项目的两个因素,但是我遇到了一些问题:在我的站点中,我添加了一个setup.html页面,在我的urls.py文件中设置了url,但是我一直收到这个错误:
In template C:\Users\Us\lib\site-packages\allauth\templates\base.html, error at line 26
Reverse for 'account_email' not found. 'account_email' is not a valid view function or pattern name.
我正在使用django 2.2.3,我正在覆盖django-allauth模板,在password_reset_from_key模板上我遇到了一个NoReverseMatch异常,
Reverse for 'account_reset_password_from_key' with no arguments not found. 1 pattern(s) tried: ['accounts/password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$']
所以它需要参数,而且这个参数可
我在我的django应用程序中使用django-allauth进行社交登录。当用户被提示使用社交登录对话框,Facebook登录窗口用于ex.时,他可以选择拒绝权限请求。
在这种情况下,用户当前正被重定向到/accounts/social/login/ case /。有什么办法可以把他转到定制的网址上吗?