ResetView, ModifyPwdView, LogoutView, IndexView from organization.views import OrgView from django.views.static import serve from StudyOnline.settings import MEDIA_ROOT 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(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_ROOT}), # 课程相关url配置
from .settings import MEDIA_ROOT from django.views.static import serve from django.conf.urls.static import static from django.conf import settings from django.urls import include from user.views import LoginView, RegisterView, ActiveView, Login, ModifyView, ForgetPwdView, ResetView, Modify, contact, ChangeInfo, Message, changeimage from bloginfo.views import AddView, DeleteView, EditView, EditAddView, get_blogs, get_details, search, EditInfo, getPerson urlpatterns = [ path('admin/', admin.site.urls), # path('', TemplateView.as_view(template_name="home.html"), name='login'), path('', Login.as_view(), name='home'), url('captcha/', include("captcha.urls")), url(r'^tinymce/', include('tinymce.urls')), path('register', RegisterView.as_view(), name="register"), url(r'^reset/(?P<active_code>.*)/$', ResetView.as_view(), name='reset_wpd'), url(r'^modify_pwd/$', ModifyView.as_view(), name='modify_pwd'), url(r'^active/(?P<active_code>.*)/$', ActiveView.as_view(), name='user_active'), url('login', LoginView.as_view(), name='user_login'), path('logout', views.logoutView, name='logout'), path('forgetpwd', ForgetPwdView.as_view(), name='forgetpwd'), path('addBlog', AddView.as_view(), name='addblog'), path('blogList', get_blogs, name='index'), path('modify', Modify.as_view(), name='modify'), path('contact', contact, name='contact'), path('deleteBlog', DeleteView.as_view(), name='delete'), path('editBlog', EditView.as_view(), name='edit'), path('editAdd', EditAddView.as_view(), name='editadd'),
path('ueditor/', include('DjangoUeditor.urls')), # path('', TemplateView.as_view(template_name=''), name='index'), path('', IndexView.as_view(), name='index'), # User Views # path('login/', user_login, name='login'), path('login/', LoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('register/', RegisterView.as_view(), name='register'), re_path('^active/(?P<active_code>.*)/$', UserActiveView.as_view(), name='user_active'), path('forget/', ForgetPasswordView.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 配置 # path('org_list/', OrgView.as_view(), name='org_list') path('org/', include(('organization.urls', 'organization'), namespace='org')), # 课程 url 配置 path('course/', include(('course.urls', 'course'), namespace='course')), # 用户 path('users/', include(('user.urls', 'users'), namespace='users')), # Blog
from MxOnline.settings import MEDIA_ROOT urlpatterns = [ url('^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(r"^org/", include("organization.urls", namespace="org")), #课程 url(r'^course/', include("course.urls", namespace="course")), #配置上传文件的处理函数 url(r"^media/(?P<path>.*/$)", serve, {"document_root": MEDIA_ROOT}), #生产环境下静态文件的处理 #url(r"^static/(?P<path>.*/$)", serve, {"document_root": STATIC_ROOT}), #用户个人信息相关配置 url(r'^users/', include("user.urls", namespace="user")), # #url(r'^ueditor/', include('DjangoUeditor.urls' )), ]
from django.views.generic import TemplateView from user.views import UserLogin, RegisterView, ActiveUserView, ForgetPwd, ResetView, ModifyPwdView from organization.views import OrgListView from django.views.static import serve from untitled12.settings import MEDIA_ROOT from message.views import getForm from user.views import LogoutView urlpatterns = [ url(r'^admin/', xadmin.site.urls), url(r'^getform/', getForm, name="getform"), url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}), url(r'^$', TemplateView.as_view(template_name='index.html'), name="index"), url('^login/', UserLogin.as_view(), name='login'), url('^reg/', RegisterView.as_view(), name='reg'), url(r'^captcha/', include('captcha.urls')), url(r'^active/(?P<active_code>.*)/', ActiveUserView.as_view(), name='active'), url('^forget/', ForgetPwd.as_view(), name='forget'), url(r'^reset/(?P<active_code>.*)/', ResetView.as_view(), name='reset'), url(r'^modify_pwd/$', ModifyPwdView.as_view(), name="modify_pwd"), url(r'^org/', include('organization.urls', namespace='org')), url(r'^course/', include('course.urls', namespace='courses')), url(r'^user/', include('user.urls', namespace='users')), # 退出登录 url(r'^logout/$', LogoutView.as_view(), name='logout'), ]
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,re_path import xadmin from django.views.static import serve from django.views.generic import TemplateView from user.views import LoginView,RegisterView,ActiveView,ForgetpwdView,ResetView, ModifyPwd, LogoutView from organizition.views import OrgListView from .settings import MEDIA_ROOT 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('register/', RegisterView.as_view(),name = 'register'), path('forgetpwd/',ForgetpwdView.as_view() , name='forgetpwd'), path(r'captcha/', include('captcha.urls')), re_path(r'active/(?P<active_code>.*)', ActiveView.as_view(),name ='active'), # re_path(r'modifypwd/$', ModifyPwd.as_view(), name ='modify_pwd'), re_path(r'reset/(?P<reset_code>.*)$', ResetView.as_view(), name ='reset'), path(r'logout/', LogoutView.as_view(), name= 'logout'), # path(r'org_list/', OrgListView.as_view(), name='org_list'), path(r'org/', include(('organizition.urls','organizition'), namespace='org')), # namespace 需要提供app名字,要不然就会报错 # 上传用户文件的路径# re_path(r'media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}), ]
# 登录页面 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'^active/(?P<active_code>.*)/$', ActiveUserView.as_view(), name='register'), # 忘记密码 url(r'^forget_pwd/$', ForgetPwdView.as_view(), name='forget_pwd'), # 修改密码get url(r'^reset/(?P<reset_code>.*)/$', ResetView.as_view(), name='reset_pwd'), # 修改密码post url(r'^modify_pwd/$', ModifyPwdView.as_view(), name="modify_pwd"), # 用户 # 用户信息 url(r'info/$', UserInfoView.as_view(), name='info'), # 修改密码 url(r'change_pwd/$', ChangePwdView.as_view(), name='change_pwd'), # 用户课程表 url(r'course/$', UserCourseView.as_view(), name='course'),
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.views.generic import TemplateView from django.views.static import serve import xadmin from TeachingOnline.settings import MEDIA_ROOT from organization.views import OrgView from user.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView, ResetView urlpatterns = [ url('^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('^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='user_reset'), url('^org/', include('organization.urls', namespace='ns_org')), url('^media/(?P<path>.*)$', serve, {'document_root': MEDIA_ROOT}), url('^course/', include('courses.urls', namespace='course')), ]