import xadmin from users.views import IndexView, LoginView, LogoutView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyView urlpatterns = [ # path('admin/', admin.site.urls), # re_path('^$', TemplateView.as_view(template_name='index.html'), name='index'), re_path('^$', IndexView.as_view(), name='index'), re_path('^xadmin/', xadmin.site.urls), re_path('^login/$', LoginView.as_view(), name='login'), re_path('^logout/$', LogoutView.as_view(), name='logout'), re_path('^register/$', RegisterView.as_view(), name='register'), re_path('^captcha/', include('captcha.urls')), path('active/<str:active_code>', ActiveUserView.as_view(), name='user_active'), re_path('^forget_pwd/$', ForgetPwdView.as_view(), name='forget_pwd'), path('reset/<str:active_code>', ResetView.as_view(), name='reset_pwd'), path('modify_pwd/', ModifyView.as_view(), name='modify_pwd'), # 课程机构url配置 re_path('^org/', include('organization.urls', namespace='org')), # 课程url配置 re_path('^course/', include('courses.urls', namespace='course')), # 用户url配置 re_path('^users/', include('users.urls', namespace='users')), # 配置上传文件的访问处理函数 path('media/<path:path>', serve, {'document_root': settings.MEDIA_ROOT}, name='media'), # 配置静态文件的访问处理函数
from MxOnline.settings import MEDIA_ROOT from users.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView,\ ResetView, ResetPwdView, LogoutView, IndexView urlpatterns = [ # path('admin/', admin.site.urls), path('xadmin/', xadmin.site.urls), path('', IndexView.as_view(), name='index'), path('login/', LoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('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'), path('forgetpwd/', ForgetPwdView.as_view(), name='forget_pwd'), re_path(r'^reset/(?P<active_code>.*)/$', ResetView.as_view(), name='reset_pwd_get'), path('resetpwd/', ResetPwdView.as_view(), name='reset_pwd_post'), # 课程机构url配置 path('org/', include('organization.urls', namespace='org')), # 课程相关url配置 path('course/', include('courses.urls', namespace='course')), # 用户信息相关url配置 path('user/', include('users.urls', namespace='user')), # 配置上传文件的访问处理函数 re_path(r'^media/(?P<path>.*)$', serve, {'document_root': MEDIA_ROOT}), # re_path(r'^static/(?P<path>.*)$', serve, {'document_root': STATIC_ROOT}),
from django.conf.urls import url, include from users.views import LoginView, RegisterView, ActivateUserView, ForgetPwdView, ResetView, ModifyPwdView, \ UserInfoView, LogoutView, UploadImageView, UpdatePwdView, SendEmailCodeView, UpdateEmailView, MyCourseView, \ MyFavOrgView, MyFavTeacherView, MyFavCourseView, MyMessageView urlpatterns = [ url(r'^login/$', LoginView.as_view(), name="login"), # 登录 # 根目录匹配的时候是不需要“/”的所以要把/login/的“/”去掉 url(r'^register/$', RegisterView.as_view(), name="register"), # 注册 url(r'^activate/(?P<activate_code>.*)$', ActivateUserView.as_view(), name="user_activate"), # 激活 url(r'^forget/$', ForgetPwdView.as_view(), name="forget_pwd"), # 返回找回密码页面 url(r'^reset/(?P<reset_code>.*)$', ResetView.as_view(), name="reset_pwd"), # 找回密码 url(r'^modify/$', ModifyPwdView.as_view(), name="modify_pwd"), # 处理找回密码逻辑 url(r'^logout/$', LogoutView.as_view(), name='logout'), # 退出登录 url(r'^info/$', UserInfoView.as_view(), name="user_info"), # 用户信息页及信息页个人资料修改 url(r'^image/upload/$', UploadImageView.as_view(), name='image_upload'), # 用户头像修改 url(r'^update/pwd/$', UpdatePwdView.as_view(), name='update_pwd'), # 用户个人中心修改密码 url(r'^sendemail_code/$', SendEmailCodeView.as_view(), name='sendemail_code'), # 修改邮箱时 发送邮箱验证码 url(r'^update_email/$', UpdateEmailView.as_view(), name='update_email'), # 修改邮箱时,验证邮箱和验证码 url(r'^mycourse/$', MyCourseView.as_view(), name='mycourse'), # 我的课程 url(r'^myfav/org/$', MyFavOrgView.as_view(), name='myfav_org'), # 我收藏的课程机构 url(r'^myfav/teacher/$', MyFavTeacherView.as_view(), name='myfav_teacher'), # 我收藏的授课讲师 url(r'^myfav/course/$', MyFavCourseView.as_view(), name='myfav_course'), # 我收藏的课程 url(r'^mymessage/$', MyMessageView.as_view(), name='mymessage'), # 我的消息 ]
# 用户注册 url(r'^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/$', ForgetPwdView.as_view(), name='forget_pwd'), # 点击找回密码链接 url(r'^reset/(?P<active_code>.*)/$', ResetView.as_view(), name='rest_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")), # 用户个人中心,放在 users app下 url(r'^users/', include('users.urls', namespace='users')), # 富文本 Ueditor 相关 url # url(r'^ueditor/',include('DjangoUeditor.urls' )),
from django.views.static import serve from moonlight.settings import MEDIA_ROOT, STATIC_ROOT from users.views import IndexView 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('^active/(?P<active_code>.*)/$', ActiveUserView.as_view(), name="user_active"), url('^forget/$', ForgetPwdView.as_view(), name="forget_pwd"), url('^reset/(?P<reset_code>.*)/$', ResetView.as_view(), name="reset_pwd"), url('^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 url( r'^users/', include('users.urls', namespace='users'),
import xadmin from django.views.generic import TemplateView from django.views.static import serve from MXOnline.settings import MEDIA_ROOT from organization.views import IndexView from users.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyPwdView from organization.views import OrgView urlpatterns = [ url(r'^xadmin/', xadmin.site.urls), url(r'^index/$', IndexView.as_view(), name="index"), url(r'^login/$', LoginView.as_view(), name="login"), url(r'^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/$', ForgetPwdView.as_view(), name="forget"), 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'^teacher/', include('organization.urls', namespace="org")), # 课程相关url配置 url(r'^courses/', include('courses.urls', namespace="courses")), # 个人中心相关url配置 url(r'^usercenter/', include('users.urls', namespace="usercenter")), # 配置上传文件的处理函数
urlpatterns = [ url(r'^xadmin/', xadmin.site.urls), url(r'^$', IndexView.as_view(), name="index"), url(r'^login/$', LoginView.as_view(), name="login"), url(r'^logout/$', LogoutView.as_view(), name="logout"), url(r'^register/$', RegisterView.as_view(), name="register"), #验证码 url(r'^captcha/', include('captcha.urls')), #富文本相关url url(r'^ueditor/', include('DjangoUeditor.urls')), url(r'^active/(?P<active_code>.*)/$', AciveUserView.as_view(), name="user_active"), url(r'^forget/$', ForgetPwdView.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'^users/', include('users.urls', namespace="users")), #配置上传文件的处理函数 url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}), #url(r'^static/(?P<path>.*)$',serve,{"document_root":STATIC_ROOT}), ] #全局404页面配置
from django.conf.urls.static import static #上传图片 urlpatterns = [ path('xadmin/', xadmin.site.urls,name="xadmin"), path('',HomeView.as_view(),name="home"), #首页 # 登录 # $:避免同名url # path('login/',LoginView.as_view(),name="login"), url(r'^login/$', LoginView.as_view(),name="login"), path('signup/',RegisterView.as_view(),name="signup"), #注册 path('logout/',LogoutView.as_view(),name="logout"), #注销 path('captcha/',include('captcha.urls')), #验证码 re_path('active/(?P<active_code>.*)/', ActiveUserView.as_view(), name="user_active"),#注册激活 path('forget/', ForgetPwdView.as_view(), name="forget_pwd"),#忘记密码页面 re_path('reset/(?P<active_code>.*)/', ResetView.as_view(), name="reset_pwd"), #找回密码激活 path('modify_pwd/',ModifyPwdView.as_view(), name="modify_pwd"), #重设密码 path('article/',include('article.urls',namespace='article')), #文章 path('timer_shaft/',TimerShaftView.as_view(), name="timer_shaft"), #时间轴 path('ueditor/', include('DjangoUeditor.urls')), #富文本 path('myoperation/', MyOperationView.as_view(), name="myoperation"), #收藏列表 # 展示头像 path('profile/',ProfileView.as_view(), name='profile'), # 处理头像 path('profile/ajax/avatar/',AjaxAvatarUploadView.as_view(), name='ajax_avatar_upload'), # 进度条 path('filecount/',MarkProgCount.as_view(), name='filecount'), # 第三方登录 path('', include('social_django.urls', namespace='social')) ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# from users import views urlpatterns = [ path('xadmin/', xadmin.site.urls), path('', IndexView.as_view(), name='index'), # 用户 path('login/', LoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('register/', RegisterView.as_view(), name='register'), # path('login/', views.user_login, name='login'), path('captcha/', include('captcha.urls')), re_path('active/(?P<active_code>.*)/', ActiveUserView.as_view(), name='user_active'), path('forget/',ForgetPwdView.as_view(), name='forget_pwd'), re_path(r'reset/(?P<active_code>.*)/', ResetView.as_view(), name='reset_pwd'), path('modify_pwd/', ModifyPwdView.as_view(), name='modify_pwd'), # 个人信息 path("users/", include('users.urls', namespace="users")), # 课程 path("course/", include('course.urls', namespace="course")), # 机构 path("org/", include('organization.urls', namespace="org")), # path('org_list/', OrgView.as_view(), name='org_list'), # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT re_path(r'^media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}), # 静态文件
Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from django.contrib import admin import xadmin from django.views.generic import TemplateView from users.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyPwdForm urlpatterns = [ url(r'^xadmin/', xadmin.site.urls), url('^$', TemplateView.as_view(template_name="index.html"), name="index"), url('^login/$', LoginView.as_view(), name="login"), 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/$", ForgetPwdView.as_view(), name="forget_pwd"), url(r"^reset/(?P<active_code>.*)/$", ResetView.as_view(), name="reset_pwd"), url(r"^modify_pwd/$", ModifyPwdForm.as_view(), name="modify_pwd"), ]
urlpatterns = [ path('xadmin/', xadmin.site.urls), # 用''指代根目录,TemplateView.as_view可以将template转换为view # path('', TemplateView.as_view(template_name='index.html'), name='index'), # 用户登录\注册\修改密码\邮箱验证及验证码url配置 path('', IndexView.as_view(), name='index'), path('login', LoginView.as_view(), name='login'), path('logout', LogOutView.as_view(), name='logout'), path('register', RegisterView.as_view(), name='register'), path('captcha/', include('captcha.urls')), # 验证码 re_path('user_active/(?P<active_code>.*)', ActiveUserView.as_view(), name='user_active'), path('forget', ForgetPwdView.as_view(), name='forgetpwd'), re_path('reset/(?P<active_code>.*)', ResetView.as_view(), name='reset_pwd'), path('modify_pwd', ModifyPwdView.as_view(), name='modify_pwd'), # 配置上传文件的处理 re_path('media/(?P<path>.*)', serve, {'document_root': MEDIA_ROOT}), # 配置静态文件 re_path('static/(?P<path>.*)', serve, {'document_root': STATIC_ROOT}), # 课程机构url配置 path('org/', include(('organization.urls', 'organization'), namespace='org')), # 课程url配置 path('course/', include(('courses.urls', 'courses'), namespace='course')),
path('logout/', LogoutView.as_view(), name="logout"), # 注册url path("register/", RegisterView.as_view(), name = "register" ), # 验证码url path("captcha/", include('captcha.urls')), # 激活用户url re_path('active/(?P<active_code>.*)/', ActiveUserView.as_view(), name= "user_active"), # 忘记密码 path('forget/', ForgetPwdView.as_view(), name= "forget_pwd"), # 重置密码urlc :用来接收来自邮箱的重置链接 re_path('reset/(?P<active_code>.*)/', ResetView.as_view(), name="reset_pwd"), # 修改密码url; 用于passwordreset页面提交表单 path('modify_pwd/', ModifyPwdView.as_view(), name="modify_pwd"), # 课程机构app的url配置,讲师的也在里面 path("org/", include('organization.urls', namespace='org')), # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT re_path('media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT }), # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT # re_path('static/(?P<path>.*)', serve, {"document_root": STATIC_ROOT}), # 课程app的url配置 path("course/", include('courses.urls', namespace="course")), # user app的url配置 path("users/", include('users.urls', namespace="users")),
# -*- coding: utf-8 -*- from django.conf.urls import url from users.views import LoginView, RegisterView, LogoutView, UsercenterView, ActivateUserView, ForgetpwdView, \ ResetView, SetpwdView urlpatterns = [ url(r'^login/$', LoginView.as_view(), name="login"), url(r'^logout/$', LogoutView.as_view(), name="logout"), url(r'^register/$', RegisterView.as_view(), name="register"), url(r'^forgetpwd/$', ForgetpwdView.as_view(), name="forgetpwd"), url(r'^activate/(?P<code>\w+)/$', ActivateUserView.as_view()), url(r'^reset/(?P<code>\w+)/$', ResetView.as_view(), name="resetpwd"), url(r'^setpwd/$', SetpwdView.as_view(), name="setpwd"), url(r'^centerinfo/$', UsercenterView.as_view(), name="usercenterinfo"), ]
URL configuration originally generated by "django-admin startproject" using Django 2.1.7 for the system; @author: Liu Haodong, Zhao Jichen, Ye Yifan, and Wang Annong ''' from . import views; import xadmin from django.urls import path, include, re_path from django.views.static import serve from PRS.settings import MEDIA_ROOT from users.views import LoginView, ActiveUserView, RegisterView, ForgetPwdView, ResetView, ModifyPwdView, LogoutView # the "urlpatterns" list routes URLs to views urlpatterns = [ path('me/', xadmin.site.urls), # Xadmin path('', views.home, name = 'index'), # the home page path('home/', views.home, name = 'home'), # the home page path('reg/', views.reg, name = 'reg'), # the registration page path('reg/data_refresh/', views.data_refresh, name = 'data_refresh'), # the registration page with real-time updated data path('reg/rec_reg/', views.rec_reg, name = 'rec_reg'), # the registration result page path('about/', views.about, name = 'about'), # the system introduction page path('login/', LoginView.as_view(), name = 'login'), # the login page path('sign-up/', RegisterView.as_view(), name = 'sign-up'), # the sigh-up page re_path(r'^media/(?P<path>.*)', serve, {'document_root': MEDIA_ROOT}), # the media resource management url path('captcha/', include('captcha.urls')), # the captcha resource management url re_path('active/(?P<active_code>.*)/', ActiveUserView.as_view(), name = 'user_active'), # the page showing after activating successfully path('forget/', ForgetPwdView.as_view(), name = 'forget_pwd'), # the page for asking for resetting the password re_path('reset/(?P<active_code>.*)/', ResetView.as_view(), name = 'reset_pwd'), # the page for resetting the password path('modify_pwd/', ModifyPwdView.as_view(), name = 'modify_pwd'), # the page for modifying the password path('logout/', LogoutView.as_view(), name = "logout"), # the logout page ]
url(r'^logout/', LogoutView.as_view(), name='logout'), url(r'^index/$',TemplateView.as_view(template_name='index.html'),name='index'), url(r'^$',TemplateView.as_view(template_name='page.html'),name='page'), url(r'^register/',RegisterView.as_view(),name='register'), url(r'^captcha/', include('captcha.urls')), url(r'^active/(?P<active_code>.*)/$',ActiveUserView.as_view(),name='active'), url(r'^forgetpwd/$', ForgetPwdView.as_view(),name='forgetpwd'), url(r'^reset/(?P<reset_code>.*)/$',ResetView.as_view(),name='reset'), url(r'^modify_pwd/$', ModifyPwdView.as_view(),name='modify_pwd'), #课程机构首页 url(r'^org_list/', include('organization.urls',namespace='org_list')), # 配置上传文件的访问处理函数 url(r'^media/(?P<path>.*)$',serve, {"document_root":MEDIA_ROOT}), url(r'^static/(?P<path>.*)$', serve, {"document_root": STATIC_ROOT}), # 课程相关 url(r'^course_list/', include('demos.urls', namespace='course_list')), # 讲师相关
from users.views import LoginView,RegisterView,ActiveUserView,ForgetPwdView,ResetView,ModifyPwdView from organization.views import OrgView from django.views.static import serve from MxOnline.settings import MEDIA_ROOT from users.views import LogoutView,IndexView urlpatterns = [ path('xadmin/', xadmin.site.urls), path('', IndexView.as_view(),name='index'), path('login/',LoginView.as_view(),name = 'login'), path('logout/', LogoutView.as_view(), name="logout"), path('register/',RegisterView.as_view(),name = 'register'), path('captcha/',include('captcha.urls')), re_path('active/(?P<active_code>.*)/',ActiveUserView.as_view(),name='user_active'), path('forget/',ForgetPwdView.as_view(),name='forget_pwd'), re_path('reset/(?P<active_code>.*)/', ResetView.as_view(), name='reset_pwd'), path('modify_pwd/', ModifyPwdView.as_view(), name='modify_pwd'), # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT re_path(r'^media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT }), # 课程机构app相关url配置 path("org/", include('organization.urls', namespace="org")), # 课程app相关url配置 path("course/", include('course.urls', namespace="course")), #个人信息 path("users/", include('users.urls', namespace="users")), #静态文件 # re_path(r'^static/(?P<path>.*)', serve, {"document_root": STATICFILES_DIRS }),
import xadmin from users.views import LoginView, LogoutView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyPwdView from users.views import IndexView from testonline.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/$', ForgetPwdView.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'^static/(?P<path>.*)$', serve, {"document_root": STATIC_ROOTS}), # 讲师相关url配置
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from users.views import ActiveView, ResetView, LoginView from django.views.generic import TemplateView urlpatterns = [ path('', LoginView.as_view(), name='index'), path('admin/', admin.site.urls), path('compare/', include('compare.urls'), name='compare'), path('users/', include('users.urls'), name='users'), path('schools/', include('schools.urls'), name='schools'), path('active/<slug:active_code>/', ActiveView.as_view(), name='active'), path('reset/<slug:reset_code>/', ResetView.as_view(), name='reset'), path('search/', TemplateView.as_view(template_name='search_method.html'), name='search_method'), ]
from django.conf.urls import patterns, include, url from django.contrib import admin from users.views import HandlerView from users.views import ResetView from users.views import TestView admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^users/login$', HandlerView.as_view(), name='my-view'), url(r'^users/add$', HandlerView.as_view(), name='my-view'), url(r'^TESTAPI/resetFixture$', ResetView.as_view(), name='reset-view'), url(r'^TESTAPI/unitTests$', TestView.as_view(), name='test-view'), url(r'^client.html$', HandlerView.as_view(), name='my-view'), url(r'^client.js$', HandlerView.as_view(), name='my-view'), url(r'^client.css$', HandlerView.as_view(), name='my-view'), )
1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from django.contrib import admin from django.views.generic import TemplateView from django.views.static import serve import xadmin from Teacher.settings import MEDIA_ROOT from users.views import LoginView, RegisterView, ActiveUserView, ForgetView, ResetView, ModifyPwdView ,LogoutView urlpatterns = [ url(r'^teacher/', xadmin.site.urls,name='teacher'), url('^$', TemplateView.as_view(template_name='index.html'), 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'activity/(?P<active_code>.*)/$', ActiveUserView.as_view(), name="user_active"), url(r'^forget', ForgetView.as_view(), name="forget_pwd"), url(r'^modify_pwd', ModifyPwdView.as_view(), name="modify_psw"), url(r'reset/(?P<active_code>.*)/$', ResetView.as_view(), name="user_active"), url(r'^media/(?P<path>.*)$', serve, {"document_root":MEDIA_ROOT}), url(r'^users/', include('users.urls',namespace="users")), url(r'^questions/', include('questions.urls',namespace="questions")), url(r'^exam/', include('exam.urls',namespace="exam")), url(r'^class/', include('classs.urls',namespace="class")), url(r'^operation/', include('operation.urls',namespace="operation")), ]
from django.conf.urls.static import static import xadmin from users.views import LoginView, LogoutView, RegisterView, ActiveUserView, \ ForgetPasswordView, ResetView, ModifyView from operation.views import IndexView from new_muxue_course_online.settings import MEDIA_ROOT urlpatterns = [ path('', IndexView.as_view(), name='index'), path('xadmin/', xadmin.site.urls), path('captcha/', include('captcha.urls')), path('login/', LoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('register/', RegisterView.as_view(), name='register'), path('active/<active_code>', ActiveUserView.as_view(), name='user_active'), path('forget_pwd/', ForgetPasswordView.as_view(), name='forget_pwd'), path('reset/<active_code>', ResetView.as_view(), name='reset_password'), path('modify_pwd/', ModifyView.as_view(), name='modify_password'), path('org/', include(('apps.organization.urls', 'organization'), namespace="org")), path('courses/', include(('apps.courses.urls', 'courses'), namespace="course")), path('op/', include(('apps.operation.urls', 'operation'), namespace="op")), path(r'users/', include(('apps.users.urls', "users"), namespace="users")), ] urlpatterns += static('/media/', document_root=MEDIA_ROOT)
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from django.contrib import admin import xadmin from django.views.generic import TemplateView from users.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView, ResetView from organization.views import OrgList from django.views.static import serve from django_learn.settings import MEDIA_ROOT urlpatterns = [ url(r'^xadmin/', xadmin.site.urls), #url(r'^form/$', getform, name='UserMessageForm') url('^$', TemplateView.as_view(template_name='index.html'), name='index'), url('^login/$', LoginView.as_view(), name='login'), url('^register/$', RegisterView.as_view(), name='register'), url(r'^captcha/', include('captcha.urls')), url(r'^verifyCode/$', ActiveUserView.as_view(), name='verifyCode'), url(r'^forgetpwd/$', ForgetPwdView.as_view(), name='forgetpwd'), url(r'^pwdReset/$', ResetView.as_view(), name='pwdReset'), url(r'^org-list/$', OrgList.as_view(), name='org_list'), url(r'media/(?P<path>.*)$', serve, {'document_root': MEDIA_ROOT}) ]
from django.urls import include, path, re_path from django.views.generic import TemplateView from django.views.static import serve from SchoolOnline.settings import MEDIA_ROOT from users.views import (ActiveUserView, ForgetPwdView, LoginView, ModifyPwdView, RegisterView, ResetView) urlpatterns = [ # 公共 # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT re_path(r'^media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}), path('', TemplateView.as_view(template_name='index.html'), name='index'), re_path('active/(?P<active_code>.*)/', ActiveUserView.as_view(), name='user_active'), path('captcha/', include('captcha.urls')), path('forget/', ForgetPwdView.as_view(), name='forget_pwd'), path('login/', LoginView.as_view(), name='login'), path('modify_pwd/', ModifyPwdView.as_view(), name='modify_pwd'), path('register/', RegisterView.as_view(), name='register'), re_path('reset/(?P<active_code>.*)/', ResetView.as_view(), name='reset_pwd'), path('xadmin/', xadmin.site.urls), # 机构 # path('org_list/', OrgView.as_view(), name='org_list'), path("org/", include('organization.urls', namespace="org")), ]
from users.views import IndexView import xadmin urlpatterns = [ # url(r'^admin/', admin.site.urls), url(r'^xadmin/', xadmin.site.urls), url('^$', IndexView.as_view(), name='index'), #处理静态文件?什么意思 这里的功能好像是不需要写视图函数,直接将index.html文件传到浏览器 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<code>.*)/$', ActiveView.as_view(), name='user_active'), #密码重置 url(r'^reset/(?P<code>.*)/$', ResetView.as_view(), name='user_reset'), url(r'^modify_pwd/$', ModifyPwdView.as_view(), name='modify_pwd'), url(r'^forget/$', ForgetPwdView.as_view(), name='forget_pwd'), #课程机构url配置 url(r'^org/', include('organization.urls', namespace='org')), # #课程机构首页 # url(r'^org_list/$',OrgView.as_view(),name='org_list'), # 课程相关url配置 url(r'^course/', include('courses.urls', namespace='course')), # 用户相关url配置 url(r'^users/', include('users.urls', namespace='users')), #处理media信息