Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 无法查看allauth登录和注册页面_Python_Django - Fatal编程技术网

Python 无法查看allauth登录和注册页面

Python 无法查看allauth登录和注册页面,python,django,Python,Django,我一直遵循YouTube上的教程,使用allauth创建facebook登录和注册过程 但是,每当我尝试访问url/帐户/登录时,加载的页面就是我的索引/主页。不知道我做错了什么 这是我的URL.py文件 from django.contrib import admin from catalog import views from django.urls import path, include from django.contrib.auth.views import LoginView u

我一直遵循YouTube上的教程,使用allauth创建facebook登录和注册过程

但是,每当我尝试访问url/帐户/登录时,加载的页面就是我的索引/主页。不知道我做错了什么

这是我的URL.py文件

from django.contrib import admin
from catalog import views
from django.urls import path, include
from django.contrib.auth.views import LoginView
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.index, name='index'),
    path('about/', views.about, name='about'),
    path('courses/', views.courses, name='courses'),
    path('course-details/', views.coursedetails, name='course-details'),
    path('accounts/',include('allauth.urls')),
settings.py:

INSTALLED_APPS = [
    'sendemail.apps.SendemailConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.socialaccount.providers.facebook',
    'django_extensions'
]
SITE_ID = 1
...
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]
这是my views.py文件

from django.shortcuts import render
from django.contrib.auth import login, authenticate
#home page view
def index(request):
    return render(request, "index.html")
#about page
def about(request):
    return render(request, "about-us.html")
#courses page
def courses(request):
    return render(request, "courses.html")
#the course details page
def coursedetails(request):
    return render(request,"course-details.html")

发布您的登录视图also@bmons我已经发布了我的意思是你的view.py文件login@bmons哦,抱歉,有更新如果您没有登录的特定视图,如果您使用的是django allauth,您可以在模板{%url'帐户\登录“%”中调用登录