コード例 #1
0
import xadmin

from users.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyPwdView, \
    LogOutView, IndexView
from MxOnline.settings import MEDIA_ROOT, STATIC_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<reset_code>.*)/$', ResetView.as_view(), name="reset_pwd"),
    # 重置密码界面
    url(r'^modify/$', ModifyPwdView.as_view(), name="modify_pwd"),
    # 配置上传文件的访问处理函数
    url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
    # 配置static文件的处理路径
コード例 #2
0
ファイル: urls.py プロジェクト: GitLaser/mxzx
urlpatterns = [

    # 后台管理
    url(r'^admin/', xadmin.site.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'^captcha/', include('captcha.urls')),

    # 忘记密码
    url(r'^forget_pwd/$',ForgetPwdView.as_view(), name='forget_pwd'),

    # 打开邮箱里重置密码的链接,执行此处,跳转到密码重置页面
    url(r'^RedirectToReset/(?P<activate_code>.*)/$', RedirectToResetView.as_view(), name='RedirectToReset'),

    # 重置密码
    url(r'^resetpwd',ResetPwdView.as_view(), name='resetpwd'),

    # 搜索结果
    url(r'^search_result',SearchView.as_view(), name='search_result'),
コード例 #3
0
from django.conf.urls import include, url
from django.contrib import admin
from users.views import LoginView, LogOutView, SignupView

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),

    #Este es el redireccionamiento de la parte de users
    url(r'^login$', LoginView.as_view(), name='users_login'),
    url(r'^logout$', LogOutView.as_view(), name='users_logout'),
    url(r'^signup$', SignupView.as_view(), name='users_signup'),
]


コード例 #4
0
from django.conf.urls import url, include

from users import views as user_views
from rest_framework import routers
from users.views import LoginView, LogOutView

urlpatterns = [
    # url(r'^role/list', user_views.RoleListView.as_view(), name='role_list'),
    url(r'^login/', LoginView.as_view(), name='manager_login'),
    url(r'^logout/', LogOutView.as_view(), name='manager_logout'),
]
コード例 #5
0
from django.urls import path

from users.ProfilesViews import ProfilesView
from users.views import LoginView, SignUpView, LogOutView
from . import views

app_name = 'users'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login_page'),
    path('logout/', LogOutView.as_view(), name='logout_page'),
    path('profile/', ProfilesView.as_view(), name='profile_page'),
    path('signup/', SignUpView.as_view(), name='signup_page'),
]
コード例 #6
0
from django.views.generic import TemplateView  # 处理静态文件
from django.views.static import serve  # 处理静态文件

import xadmin
from users.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyPwdView, LogOutView, IndexView
from Mxonline.settings import MEDIA_ROOT, STATIC_ROOT

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}),