6-315/blog/users/urls.py

17 lines
585 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#进行users子应用的视图路由
from django.urls import path
from users.views import RegisterView
from users.views import LoginView
from users.views import LogoutView
from users.views import WriteBlogView
urlpatterns = [
# 参数1路由
# 参数2视图函数
# 参数3路由名方便通过reverse来获取路由
path('register/',RegisterView.as_view(),name='register'),
path('login/',LoginView.as_view(),name='login'),
path('logout/',LogoutView.as_view(),name='logout'),
path('writeblog/', WriteBlogView.as_view(), name='writeblog'),
]