django - 如何在 django 中更改默认模板身份验证登录这不起作用?
问题描述
如何在 django 中更改默认模板身份验证登录这不起作用?
urlpatterns = [ path('',views.registration,name='registration'),
path('login/',auth_views.LoginView.as_view(template_name='login.html'),),
解决方案
它不起作用,因为您错误地传递了模板。
应用程序文件夹应如下所示:
App_name/templates/App_name/login.html
如果您的 App_name 是用户,它将是这样的:
path('login/', auth_views.LoginView.as_view(template_name='users/login.html'), name='login'),
推荐阅读
- python - 如何将 xgboost 集成到 spark 中?(Python)
- reactjs - Error shallow Jest Enzyme React cannot find "store"
- straight-line-detection - 如何找到通过最多点的直线?
- node.js - 尝试使用 nodeJS 调用 MongoDB 时未定义获取错误“DB”
- math - 优化函数(例如,电容器充电)曲线的参数以拟合数据
- javascript - iOS Safari Web Audio API 限制问题
- php - API 为不同的参数返回 500 'Internal Server Error'
- c# - .NET Core 子域地址与区域
- java - 如何使用 R2dbc 从 Postgresql 中提取 jsonb 到 Spring webflux
- android - 当我克隆我的 github 项目时,我的项目不工作