#Perform view routing of users sub-applications from django.urls import path from users.views import RegisterView, ImageCodeView, LoginView, LogoutView, ForgetPasswordView, UserCenterView, WriteBlogView urlpatterns = [ #The first parameter of path: routing #The second parameter of path: view function name path('register/',RegisterView.as_view(), name='register'), #Image verification code routing path('imagecode/', ImageCodeView.as_view(), name='imagecode'), path('login/',LoginView.as_view(),name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('forgetpassword/', ForgetPasswordView.as_view(), name='forgetpassword'), path('center/', UserCenterView.as_view(), name='center'), path('writeblog/',WriteBlogView.as_view(), name='writeblog'), ]
from users.views import ImageCodeView from users.views import SmsCodeView from users.views import LoginView from users.views import ForgetPasswordView from users.views import LogoutView from users.views import UserCenterView from users.views import WriteBlogView urlpatterns = [ #path的第一个参数是;路由 #第二个参数是视图函数名 path('register/', RegisterView.as_view(), name='register'), # path('register/',RegisterView.as_view(),name='register'), #图片验证码路由 #首页联系管理订阅订阅随笔- 53 文章- 0 评论- 7 # django基类View.as_view() path('imagecode/', ImageCodeView.as_view(), name='imagecode'), #短信验证码 path('smscode/', SmsCodeView.as_view(), name='smscode'), #登录路由 path('login/', LoginView.as_view(), name='login'), #忘记密码路由 path('forgetpassword/', ForgetPasswordView.as_view(), name='forgetpassword'), path('logout/', LogoutView.as_view(), name='logout'), path('center/', UserCenterView.as_view(), name='center'), #写博客路由 path('writeblog', WriteBlogView.as_view(), name="writeblog") ]
from django.urls import path from home.views import IndexView, DatailView from users.views import WriteBlogView urlpatterns = [ #首页路由 path('', IndexView.as_view(), name='index'), #写博客路由 path('write/', WriteBlogView.as_view(), name='write'), #详情页面路由 path('detail/', DatailView.as_view(), name='detail'), ]
from django.conf.urls import url from users.views import RegisterView, ImageCodeView from users.views import SmsCodeView, LoginView from users.views import LogoutView, ForgetPasswordView from users.views import UserCenterView, WriteBlogView urlpatterns = [ # 参数1:路由 # 参数2:视图函数 # 参数3:路由名,方便通过reverse来获取路由 url(r'^register/', RegisterView.as_view(), name='register'), url(r'^imagecode/', ImageCodeView.as_view(), name='imagecode'), url(r'^smscode/', SmsCodeView.as_view(), name='smscode'), url(r'^login/', LoginView.as_view(), name='login'), url(r'^logout/', LogoutView.as_view(), name='logout'), url(r'^forgetpassword/', ForgetPasswordView.as_view(), name='forgetpassword'), url(r'^center/', UserCenterView.as_view(), name='center'), url(r'^writeblog/', WriteBlogView.as_view(), name='writeblog'), ]
# 进行users 子应用的视图路由 from django.urls import path from users.views import RegisterView, ImageCodeView, SmsCodeView, LoginView, LogoutView, ForgetPasswordView, UserCenterView, WriteBlogView, SelfBlogView urlpatterns = [ # path第一个参数:路由 # path第二个参数:视图函数名 path('register/', RegisterView.as_view(), name='register'), # 图片验证码路由 path('imagecode/', ImageCodeView.as_view(), name='imagecode'), # 短信发送路由 path('smscode/', SmsCodeView.as_view(), name='smscode'), # 登录路由 path('login/', LoginView.as_view(), name='login'), # 登出路由 path('logout/', LogoutView.as_view(), name='logout'), # 忘记密码路由 path('forget_password/', ForgetPasswordView.as_view(), name='forgetpassword'), # 用户中心路由 path('center/', UserCenterView.as_view(), name='center'), # 写博客路由 path('write_blog/', WriteBlogView.as_view(), name='writeblog'), # 个人博客路由 path('self_blog/', SelfBlogView.as_view(), name='selfblog') ]
from django.urls import path from users.views import RegisterView, ImageCodeView, SmsCodeView, LoginView from users.views import LogoutView, ForgetPasswordView, UserCenterView, WriteBlogView urlpatterns = [ # 参数1:路由 # 参数2:视图函数 # 参数3:路由名,方便通过reverse来获取路由 path("register/", RegisterView.as_view(), name="register"), path("imagecode/", ImageCodeView.as_view(), name="imagecode"), path("smscode/", SmsCodeView.as_view(), name="smscode"), path("login/", LoginView.as_view(), name="login"), path("logout/", LogoutView.as_view(), name="logout"), path("forgetpassword/", ForgetPasswordView.as_view(), name="forgetpassword"), path("center/", UserCenterView.as_view(), name="center"), path("writeblog/", WriteBlogView.as_view(), name="writeblog"), ]