from hongzhenye.settings import MEDIA_ROOT urlpatterns = [ # path('admin/', admin.site.urls), path('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('^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<active_code>.*)/$', ResetView.as_view(), name='reset_pwd'), url('^modify_pwd/$', ModifyPwdView.as_view(), name='modify_pwd'), url(r'^media/(?P<path>.*)$', serve, {'document_root': MEDIA_ROOT}), # re_path(r'^static/(?P<path>.*)$', serve,{'document_root':STATIC_ROOT}), url('ueditor/', include('DjangoUeditor.urls')), #课程机构url配置 url('^org/', include('organization.urls', namespace='org')), # 课程app相关url配置 url('^course/', include('courses.urls', namespace='course')), # 课程 相关url配置 url('^users/', include('users.urls', namespace='users')), ] #全局404页面配置 handler404 = 'apps.users.views.page_not_found' #全局500页面配置 handler500 = 'apps.users.views.page_error'
from MxOnline.settings import STATIC_ROOT urlpatterns = [ path('xadmin/', xadmin.site.urls), path('', TemplateView.as_view(template_name='index.html'), name='index'), path('login/', LoginView.as_view(), name='login'), 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'), path("org/", include('organization.urls', namespace="org")), # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT re_path(r'^media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}), path("course/", include('course.urls', namespace="course")), re_path('course/(?P<course_id>\d+)/', CourseDetailView.as_view(), name="course_detail"), # 课程章节信息页 re_path('info/(?P<course_id>\d+)/', CourseInfoView.as_view(), name="course_info"), # 个人信息 path("users/", include('users.urls', namespace="users")),
3. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import url, include from django.views.generic import TemplateView from django.views.static import serve import xadmin from apps.users.views import LoginView, RegisterView, ActiveUserView, \ ForgetPwdView, ResetView, ModifyPwdView from apps.organization.views import OrgView from settings import MEDIA_ROOT 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'^reset/(?P<active_code>.*)/$', ResetView.as_view(), name="reset_pwd"), url(r'^forget/$', ForgetPwdView.as_view(), name="forget_pwd"), url(r'^modifypwd/$', ModifyPwdView.as_view(), name="modify_pwd"), # 课程机构首页 url(r'^org_list/$', OrgView.as_view(), name="org_list"), # 处理静态文件,上传文件的访问处理 url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}) ]
ModifyPwdView, IndexView from .settings import MEDIA_ROOT urlpatterns = [ url(r'^xadmin/', xadmin.site.urls), url(r'^ueditor/', include('DjangoUeditor.urls')), url(r'^$', IndexView.as_view(), name='index'), url(r'^login/$', LoginView.as_view(), name='login'), url(r'^register/$', RegisterView.as_view(), name='register'), url(r'^logout/$', LogoutView.as_view(), name='logout'), url(r'^active/(?P<active_code>.*)/$', ActiveUserView.as_view(), name='active'), url(r'^forget/$', ForgetPwdView.as_view(), name='forget'), url(r'^reset/(?P<active_code>.*)/', ResetView.as_view(), name='reset'), url(r'^modify/$', ModifyPwdView.as_view(), name='modify'), url(r"^users/", include(('apps.users.urls', 'users'), namespace="users")), url(r"^org/", include(('apps.organization.urls', 'organization'), namespace="org")), url(r"^course/", include(('apps.courses.urls', 'courses'), namespace="courses")), url(r'^captcha/', include('captcha.urls')), # 验证码 url(r'^media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}), # url(r'^static/(?P<path>.*)', serve, {"document_root": STATIC_ROOT}), ] # 全局404页面配置 handler404 = 'apps.users.views.pag_not_found' # 全局500页面配置 handler500 = 'apps.users.views.page_error'
# 退出功能url path('logout/', LogoutView.as_view(), name="logout"), # 验证码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"), # 重置密码url :用来接收来自邮箱的重置链接 re_path('reset/(?P<active_code>.*)/', ResetView.as_view(), name="reset_pwd"), # 修改密码url; post提交的地方与get方式url中的地址不一样 path('modify_pwd/', ModifyPwdView.as_view(), name="modify_pwd"), # 课程机构app的url配置,讲师的也在里面 path("org/", include('apps.organization.urls', namespace='org')), # 课程机构首页url # path('org_list/', OrgView.as_view(), name='org_list'), # 课程app的url配置 path("course/", include('apps.course.urls', namespace="course")), # re_path('course/(?P<course_id>\d+)/', CourseDetailView.as_view(), name="course_detail"), # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT re_path('media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}), # url(r'^static/(?P<path>.*)$', serve, {"document_root":STATIC_ROOT}), # user app的url配置 path("users/", include('apps.users.urls', namespace="users")), # 富文本相关url path('ueditor/', include('DjangoUeditor.urls')),