一、错误位置
from django.urls import path
from users_app.views import RegisterView, LoginView, LogoutView
app_name = 'users'
urlpatterns = [
path("register/", RegisterView.as_view, name="register"),
path("login/", LoginView.as_view, name="login"),
path("logout/", LogoutView.as_view, name="logout"),
]
三、解决办法
as_view作为一个方法后面需要+()
path("register/", RegisterView.as_view(), name="register"),
path("login/", LoginView.as_view(), name="login"),
path("logout/", LogoutView.as_view(), name="logout"),