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") ]
#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 ResetView from users.views import ModifyPwdView from users.views import IndexView from LfLearning.settings import MEDIA_ROOT urlpatterns = [ # 用户 url(r'^xadmin/', xadmin.site.urls), url('^$', IndexView.as_view(), name="index"), url('^login/$', LoginView.as_view(), name="login"), url('^logout/$', LogoutView.as_view(), name="logout"), url('^register/$', RegisterView.as_view(), name="register"), url(r'^captcha/', include('captcha.urls')), url(r'^active/(?P<active_code>.*)/$', ActiveUserView.as_view(), name="user_active"), url(r'^forget/$', ForgetPasswordView.as_view(), name="forget_pwd"), url(r'^reset/(?P<active_code>.*)/$', ResetView.as_view(), name="reset_pwd"), url(r'^modify_pwd/$', ModifyPwdView.as_view(), name="modify_pwd"), # 机构url配置 url(r'^org/', include('organization.urls', namespace="org")), # 课程url配置 url(r'^course/', include('courses.urls', namespace="course")), # 上传文件访问(图片) url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}), # 用户个人中心 url(r'^users/', include('users.urls', namespace="users")), ]
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from django.views.generic import TemplateView from django.conf.urls.static import static from .settings import MEDIA_ROOT, MEDIA_URL import xadmin from users.views import LoginView, RegisterView, ActiveUserView, ForgetPasswordView app_name = 'organization' urlpatterns = [ path('xadmin/', xadmin.site.urls), path('index/', TemplateView.as_view(template_name="index.html"), name="index"), path('login/', LoginView.as_view(), name="login"), path('logout/', TemplateView.as_view(template_name="login.html"), name="logout"), path('register/', RegisterView.as_view(), name="register"), path('captcha/', include('captcha.urls')), path('active/<int:active_code>', ActiveUserView.as_view(), name="active"), path('forgetpwd/', ForgetPasswordView.as_view(), name="forgetpwd"), # 授课机构url配置 path('org/', include('organization.urls', namespace='org')), ] # 配置上传文件的访问地址 urlpatterns += static(MEDIA_URL, document_root=MEDIA_ROOT)
from MxOnline.settings import MEDIA_ROOT from users.views import UserLoginView, UserRegisterView, UserActivate, ForgetPasswordView, UserResetView, user_logout # from users.views import test_ajax, test_ajax2 urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^xadmin/', xadmin.site.urls), url(r'^$', TemplateView.as_view(template_name='index.html'), name='index'), url(r'^login/$', UserLoginView.as_view(), name='user_login'), url(r'^logout/$', user_logout, name='user_logout'), url(r'^register/$', UserRegisterView.as_view(), name='user_register'), url(r'^captcha/', include('captcha.urls')), url(r'^activate/(?P<activate_code>\w+)$', UserActivate.as_view(), name='user_activate'), url(r'^forget/$', ForgetPasswordView.as_view(), name='forget_password'), url(r'^reset/(?P<activate_code>\w+)$', UserResetView.as_view(), name='user_reset'), url(r'^media/(?P<path>.*)$', serve, {'document_root': MEDIA_ROOT}), # media url 路由 # url(r'^test_ajax/$', test_ajax, name='test_ajax'), # url(r'^test_ajax2/$', test_ajax2, name='test_ajax2'), url(r'^user/', include('users.urls', namespace='user')), url(r'^org/', include('organization.urls', namespace='org')), url(r'^course/', include('course.urls', namespace='course')), url(r'^operation/', include('operation.urls', namespace='operation')), # url(r'^static/(?P<path>.*)$', serve, {'document_root': STATIC_ROOT}), # static url ]
from django.urls import re_path, include from users.views import LoginView, LogoutView, ActiveUserView, RegisterView, ForgetPasswordView, ResetUserView, UserCenterView, UploadImageView, UpdatePasswordView, EmailPinView, UpdateEmailView, MyCourseView, MyFavoriteCourseView, MyFavoriteTeacherView, MyFavoriteOrganizationView, MyMessageView urlpatterns = [ re_path(r'^login/$', LoginView.as_view(), name="login"), re_path(r'^logout/$', LogoutView.as_view(), name="logout"), re_path(r'^register/$', RegisterView.as_view(), name="register"), re_path(r'^captcha/', include('captcha.urls')), re_path(r'^active/(?P<active_code>.*)/$', ActiveUserView.as_view(), name="user_active"), re_path(r'^forget/$', ForgetPasswordView.as_view(), name="forget_password"), re_path(r'^reset/(?P<reset_code>.*)/$', ResetUserView.as_view(), name="reset_user"), re_path(r'^reset/$', ResetUserView.as_view(), name="reset_user"), re_path(r'^usercenter/$', UserCenterView.as_view(), name="usercenter"), re_path(r'^usercenter/image/upload/$', UploadImageView.as_view(), name="upload_image"), re_path(r'^usercenter/password/update/$', UpdatePasswordView.as_view(), name="update_password"), re_path(r'^usercenter/email_pin/send/$', EmailPinView.as_view(), name="email_pin"), re_path(r'^usercenter/email/update/$', UpdateEmailView.as_view(), name="update_email"),
# 进行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') ]