예제 #1
0
    LogoutView, IndexView
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页面配置
예제 #2
0
파일: urls.py 프로젝트: yyx2831/mkw
    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
from django.views.generic import TemplateView  # TemplateView可以不用自己写跳转view也可以完成跳转
from apps.users.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyOowdView
import xadmin

# TemplateView自带的view不用自己写跳转view也可以完成跳转
urlpatterns = [
    url(r'^admin/', xadmin.site.urls),
    url('^$', TemplateView.as_view(template_name="index.html"),
        name='index'),  # 使用django自带的TemplateView做跳转
    # url('^login/$', LoginView, name='login'),     # 自己写的跳转
    url('^login/$', LoginView.as_view(), name='login'),  # 登陆
    url('^register/$', RegisterView.as_view(), name='register'),  # 注册
    url(r'^captcha/', include('captcha.urls')),  # 验证码
    # 邮箱激活,解析出url aactive 后面为了验证生成的乱码, 这里<>可以随意写后面要用这个名字调用, 使用正则表达式解析的
    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/$', ModifyOowdView.as_view(), name='modify_pwd'),
]
예제 #3
0
from django.views.static import serve
from MxOnline.settings import MEDIA_ROOT
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"),
예제 #4
0
from apps.users.views import LogOutView
from django.views.static import serve
from mydjango1.settings import MEDIA_ROOT

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')),
    # 激活用户url
    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('oragnization.urls', namespace='org')),
    # 公开课
    path('cou/', include('course.urls', namespace='cou')),
    # 用户中心
    path('user/', include('users.urls', namespace='user')),

    # 访问静态文件的处理view
    re_path('media/(?P<path>.*)', serve, {'document_root': MEDIA_ROOT}),
    # re_path('static/(?P<path>.*)', serve, {'document_root': STATIC_ROOT}),
]

# handler404 = 'users.views.page_not_found'
예제 #5
0
from apps.users.views import LoginView, LogoutView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, \
    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'
예제 #6
0
파일: urls.py 프로젝트: daxiahy/mxonline
    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})
]
예제 #7
0
# __author__ = 'HankZhao'
# __date__ = '2017/12/30 20:42'
# Description:定义登陆和注册功能相关的url

from django.conf.urls import url

from apps.users.views import LoginView, RegisterView, ActiveUserView, ForgetPasswordView, ResetView, ResetPasswordView

urlpatterns = [
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^active/(?P<active_code>.*)/$',
        ActiveUserView.as_view(),
        name='active'),
    url(r'^forget/$', ForgetPasswordView.as_view(), name='forget_pwd'),
    url(r'^reset/(?P<reset_code>.*)/$', ResetView.as_view(), name='reset'),
    url(r'^reset/$', ResetPasswordView.as_view(), name='reset_password')
]