Esempio n. 1
0
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from user.views import RegisterView, ActiveView, LoginView, LogoutView, UserInfoView, UserOrderView, AddressView
from django.urls import path, re_path
'''
urlpatterns = [
    #url(r'^register$', views.register, name='register'),
    #url(r'^register_handle$', views.register_handle, name='register_handle'),
    url(r'register', RegisterView.as_view(), name='register'),
    url(r'active/(?P<token>.*)', ActiveView.as_view(), name='active'),
    url(r'login', LoginView.as_view(), name='login'),
    url(r'logout', LogoutView.as_view(), name='logout'),
    url(r'^$', login_required(UserInfoView.as_view()), name='user'), #用户中心-信息页
    url(r'^order$', login_required(UserOrderView.as_view()), name='order'), #用户中心-订单页
    url(r'^address$', login_required(AddressView.as_view()), name='address'), #用户中心-地址页面
]
'''
urlpatterns = [
    path('register', RegisterView.as_view(), name='register'),
    path('active/(?P<token>.*)', ActiveView.as_view(), name='active'),
    path('login', LoginView.as_view(), name='login'),
    path('logout', LogoutView.as_view(), name='logout'),
    path('', UserInfoView.as_view(), name='user'),  #用户中心-信息页
    path('order/(?P<page>\d+)', UserOrderView.as_view(),
         name='order'),  #用户中心-订单页
    path('address', login_required(AddressView.as_view()),
         name='address'),  #用户中心-地址页面
]
Esempio n. 2
0
from timeslot.views import TimeSlotViewSet
from service.views import ServiceViewSet
from organisation.views import OrganisationViewSet
from organisation.views import OrganisationLocationViewSet
from organisation.views import LocationContactViewSet
from appointment.views import UserAppointmentViewSet
from user import views

print("inside urls")
router = routers.DefaultRouter()
router.register(r'user', UserDetailViewSet)
router.register(r'organisation', OrganisationViewSet)
router.register(r'organisationlocation', OrganisationLocationViewSet)
router.register(r'organisationcontact', LocationContactViewSet)
router.register(r'service', ServiceViewSet)
router.register(r'timeslot', TimeSlotViewSet)
router.register(r'appointment', UserAppointmentViewSet)
urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^user/auth$', AuthUserViewSet.as_view()),
    url(r'^user/me$', MeViewSet.as_view()),
    # url(r'^', include('user.urls')),
    url(r'^api-auth/', include('rest_framework.urls',
                               namespace='rest_framework')),
    url(r'^$', include(router.urls)),
    url(r'^user/appointment/$', UserAppointmentViewSet.as_view()),
    url(r'^api/v1/auth/login/$', LoginView.as_view(), name='login'),
    url(r'^api-auth/', include('rest_framework.urls',
                               namespace='rest_framework')),
]
Esempio n. 3
0
from django.urls import path
from user.views import LoginView, home, logout

app_name = 'user'
urlpatterns = [
    path('', home, name='home'),
    path('login/', LoginView.as_view(), name='user-login'),
    path('logout/', logout, name='logout'),
]
Esempio n. 4
0
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from user import views
from user.views import RegisterView, ActiveView, LoginView, LogoutView, UserInfoView, UserOrderView, AddressView

urlpatterns = [

    #url(r'^register$', views.register, name='register'),
    #url(r'^register_handle$', views.register_handle, name='register_handle'),
    url(r'register', RegisterView.as_view(), name='register'),
    url(r'active/(?P<token>.*)', ActiveView.as_view(), name='active'),
    url(r'login', LoginView.as_view(), name='login'),
    url(r'logout', LogoutView.as_view(), name='logout'),

    #url(r'^$', login_required(UserInfoView.as_view()), name='user'), #用户中心-信息页
    #url(r'^order$', login_required(UserOrderView.as_view()), name='order'), #用户中心-订单页
    #url(r'^address$', login_required(AddressView.as_view()), name='address'), #用户中心-地址页面
    url(r'^$', UserInfoView.as_view(), name='user'),  #用户中心-信息页
    url(r'^order$', UserOrderView.as_view(), name='order'),  #用户中心-订单页
    url(r'^address$', AddressView.as_view(), name='address'),  #用户中心-地址页面
]
Esempio n. 5
0
from django.urls import path, include

from user.views import SignupView, LoginView
urlpatterns = [
    path('/signup', SignupView.as_view()),
    path('/login', LoginView.as_view())
]
Esempio n. 6
0
from django.conf.urls import url

from user.views import (RegisterView, LoginView, CenterView, AddressView,
                        InfoView, LogoutView)

urlpatterns = [
    url(r'^register/', RegisterView.as_view(), name='register'),  # 用户注册
    url(r'^login/', LoginView.as_view(), name='login'),  # 用户登陆
    url(r'^center/', CenterView.as_view(), name='center'),  # 个人中心
    url(r'^address/', AddressView.as_view(), name='address'),  # 收货地址
    url(r'^info/', InfoView.as_view(), name='info'),  # 个人资料
    url(r'^logout/', LogoutView.as_view(), name='logout')  # 退出
]
Esempio n. 7
0
)
# 使用 viewset 路由管理
router = DefaultRouter()
# 账号管理
router.register(r'user', UserViewset, base_name='账号管理')
# 普通用户管理
router.register(r'member', MemberViewset, base_name='用户管理')
# 权限管理
router.register(r'auth', AuthViewset, base_name='权限管理')
# 系统字典管理
router.register(r'confdict', ConfDictViewset, base_name='系统字典管理')
# 全文检索路由 检索系统字典
router.register(r'searchdict', ConfDictSearchView, base_name='全文检索系统字典')
# 修改用户个人信息
router.register(r'updateuser', WeChatUpdateUserViewset, basename='修改个人信息')


urlpatterns = [
    url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
    url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
    path('', include(router.urls)),
    path('adminlogin/', LoginView.as_view(), name='后台登录'),
    path('wxminilogin/', WeChatMiniLoginView.as_view(), name='微信小程序登录'),
    path('wxapplogin/', WeChatAppLoginView.as_view(), name='微信APP三方登录'),
    path('uploadfile/', UploadLocalFile.as_view(), name='文件上传'), # UploadFile UploadLocalFile 
    path('test/', TestView.as_view(), name='测试接口'),
    path('userinfo/', UserInfo.as_view(), name='个人信息'),
    path('celery/', BeginCelery.as_view(), name='celery测试'),
]
Esempio n. 8
0
__author__ = 'Administrator'

from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from user.views import RegisterView, ActiveView, LoginView, LogoutView, UserInfoView, AddressView, UserOrderView

urlpatterns = [
    url(r'^register$', RegisterView.as_view(), name='register'),
    url(r'^active/(?P<token>.*)$', ActiveView.as_view(), name='active'),
    url(r'^login$', LoginView.as_view(), name='login'),
    url(r'^logout$', LoginView.as_view(), name='logout'),
    url(r'^$', UserInfoView.as_view(), name='user'),
    url(r'^order/(?P<page>\d+)$', UserOrderView.as_view(), name='order'),
    url(r'^address$', AddressView.as_view(), name='address')
]
Esempio n. 9
0
from django.urls import path, re_path
from user.views import (
    RegisterView,
    ActiveView,
    LoginView,
    UserInfoView,
    UserOrderView,
    AddressView,
    LogoutView,
)

urlpatterns = [
    path("register", RegisterView.as_view(), name="register"),
    re_path("active/(?P<token>.*)$", ActiveView.as_view(), name="active"),
    path("login", LoginView.as_view(), name="login"),
    path("logout", LogoutView.as_view(), name="logout"),
    path("", UserInfoView.as_view(), name="user"),
    path("order/<int:page>", UserOrderView.as_view(), name="order"),
    path("address", AddressView.as_view(), name="address"),
]
from django.conf.urls import url
from user.views import (ResentOTPView, OTPVerificationView, ChangePasswordView,
                        LoginView, LogoutView, SignUpView)

urlpatterns = [
    url(r'^signup$', SignUpView.as_view()),
    url(r'^re-sent-otp$', ResentOTPView.as_view()),
    url(r'^otp-verification$', OTPVerificationView.as_view()),
    url(r'^reset-password$', ChangePasswordView.as_view()),
    url(r'^login$', LoginView.as_view()),
    url(r'^logout$', LogoutView.as_view()),
]
Esempio n. 11
0
"""myPro URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/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 subject.views import index
from user.views import LoginView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('user/', include('user.urls')),
    path('', LoginView.as_view(), name='index'),
    path('subject/', include('subject.urls', namespace='subject')),
    path('stage/', include('stage.urls')),
    path('outline/', include('outline.urls', namespace='outline')),
    path('program/', include('program.urls', namespace='program'))
]
Esempio n. 12
0
router.register(r'userAlipayRealInfo',
                user_trade_views.UserAlipayRealInfoViewSet,
                base_name='userAlipayRealInfo')

router.register(r'getOrderByTBOrderNumberList',
                user_views.GetOrderByTBOrderNumberListViewSet,
                base_name='getOrderByTBOrderNumberList')  # new

#  获取用户被邀请用户信息

router.register(r'inviteInfo',
                user_views.InviteInfoViewSet,
                base_name='inviteInfo')

urlpatterns = [
    url('login/', LoginView.as_view()),  # new
    # 修改支付密码
    url('alterPayPwd/', AlterPayPasswordView.as_view()),  # new
    # 修改登录密码
    url('alterPwd/', AlterPasswordView.as_view()),  # new
    url('ordersPay/', user_trade_views.OrderPayView.as_view()),  # new
    # 充值
    url('recharge/', user_trade_views.BalanceRecharge.as_view()),  # new
    # 根据穿过来的字段检查用户是否存在
    url('checkUser/', user_views.UserCheckView.as_view()),  # new
    # 找回密码
    url('forget_password/', user_views.ForgetPasswordView.as_view()),  # new
    # 重置密码
    url('reset_password/', user_views.ResetPasswordView.as_view()),  # new
    # 修改商品信息
    url('alterOrderGoodsDetails/',
Esempio n. 13
0
from django.urls import path
from user.views  import SignupView, LoginView, FollowView

urlpatterns = [
    path('signup', SignupView.as_view()),
    path('login' , LoginView.as_view()),
    path('follow', FollowView.as_view()),
    path('login' , LoginView.as_view()),
]
Esempio n. 14
0
    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')),
]
Esempio n. 15
0
from jobuser.views import StripePayTestView, StripePayView
from .acceptable_urls import URLS

app_name = 'ourjobfund'

urlpatterns = [
    url(r'^' + URLS['stripe'] + '/$', stripe, name='stripe'),
    url(
        r'^' + URLS['robots'] + '/$',
        TemplateView.as_view(template_name='robots.txt',
                             content_type="text/plain")),
    path('' + URLS['accounts'] + '/', include('django.contrib.auth.urls')),
    url(r'' + URLS['search-user'] + '/$', search_user),
    url(r'^' + URLS['admin'] + '/', admin.site.urls),
    url(r'^' + URLS['job'] + '/', include('job.urls')),
    url(r'^' + URLS['login'] + '/$', LoginView.as_view(), name='login'),
    url(r'^' + URLS['logout'] + '/$', sign_out, name='logout'),
    url(r'^$', home, name='home'),
    url(r'^' + URLS['update'] + '/', include('update.urls')),
    url(r'^' + URLS['pledge'] + '/' + URLS['job_random_string_regex'] + '/$',
        PledgeView.as_view(),
        name='pledge'),
    url(r'^' + URLS['pledge-history'] + '/' + URLS['job_random_string_regex'] +
        '/$',
        PledgeHistoryView.as_view(),
        name='pledge-history'),
    url(
        r'^' + URLS['pledge-history'] + '/' + URLS['job_random_string_regex'] +
        '/' + URLS['sort'] + '/$', sort_pledge_history),
    url(r'^' + URLS['work'] + '/' + URLS['job_random_string_regex'] + '/$',
        WorkView.as_view(),
Esempio n. 16
0
                        RegisterHealthProfessionalView,
                        ResetPasswordView,
                        ShowHomePageView,
                        ShowPatientsView,
                        ShowHealthProfessionalView,
                        UpdateHealthProfessional,
                        UpdatePatient,
                        ConfirmAccountView,
                        UpdateUserPassword,
                        AddPatientView,
                        ListLinkedPatientsView
                        )


urlpatterns = (
    url(r'^login_patient/$', LoginView.as_view(), name='login_patient'),
    url(r'^login_healthprofessional/$', LoginView.as_view(), name='login_healthprofessional'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^reset/$', ResetPasswordView.as_view(), name='reset_password'),
    url(r'^reset_confirm/(?P<activation_key>\w+)/$', ConfirmPasswordView.as_view(), name='confirm_password'),
    url(r'^home/$', ShowHomePageView.as_view(), name='home'),
    url(r'^register_health_professional/$', RegisterHealthProfessionalView.as_view(), name='register'),
    url(r'^view_health_professional/$', permission_required('is_staff')(ShowHealthProfessionalView.as_view()), name='view_health_professional'),
    url(r'^edit_health_professional/(?P<pk>[0-9]+)/$', UpdateHealthProfessional.as_view(), name='edit'),
    url(r'^delete_health_professional/(?P<pk>[0-9]+)/$', DeleteHealthProfessional.as_view(), name='delete'),
    url(r'^register_patient/(?P<activation_key>\w+)/$', RegisterPatientView.as_view(), name='register_patient'),
    url(r'^view_patient/$', permission_required('is_staff')(ShowPatientsView.as_view()), name='view_patient'),
    url(r'^edit_profile/$', EditProfileView.as_view(), name='edit_profile'),
    url(r'^edit_patient/(?P<pk>[0-9]+)/$', UpdatePatient.as_view(), name='edit_patient'),
    url(r'^confirm/(?P<activation_key>\w+)/$', ConfirmAccountView.activate_register_user, name='confirm_account'),
    url(r'^editpasswordpatient/(?P<email>[\w|\W]+)/$', UpdateUserPassword.edit_patient_password_view, name='edit_patient_password'),
Esempio n. 17
0
#       terms_of_service="https://www.google.com/policies/terms/",
#       contact=openapi.Contact(email="*****@*****.**"),
#       license=openapi.License(name="BSD License"),
#    ),
#    public=True,
#    permission_classes=[permissions.AllowAny],
# )

urlpatterns = [
    # url('',schema_view),
    # url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
    # url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    # url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
    # path('openapi', get_schema_view(
    #     title="Your Project",
    #     description="API for all things …"
    # ), name='openapi-schema'),
    path('docs/', schema_view, name="docs"),
    path('api-docs/', include_docs_urls(title='photoshare API')),
    path('admin/', admin.site.urls),
    path('api-login/', LoginView.as_view(), name='knox_login'),
    path('api-logout/', knox_views.LogoutView.as_view(), name='knox_logout'),
    path('api-logoutall/', knox_views.LogoutAllView.as_view(), name='knox_logoutall'),
    path('accounts/', include('django.contrib.auth.urls')),
    path('api-user/',include('user.urls')),
    path('api-post/',include('post.urls')),
]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \
              + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# if settings.DEBUG:
#     urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Esempio n. 18
0
from django.conf.urls import url

from user.views import RegisterView, LoginView, MemberView, InforView, PasswordView, SaftystepView, ForgetpasswordView, \
    SendMsm, Address, AddressList

urlpatterns = [
    url(r'^register/$',RegisterView.as_view(),name="注册"),
    url(r'^login/$', LoginView.as_view(), name="登录"),
    url(r'^member/$', MemberView.as_view(), name="个人中心"),
    url(r'^infor/$', InforView.as_view(), name="个人资料"),
    url(r'^saftystep/$', SaftystepView.as_view(), name="安全设置"),
    url(r'^password/$', PasswordView.as_view(), name="修改密码"),
    url(r'^forgetpassword/$', ForgetpasswordView.as_view(), name="忘记密码"),
    url(r'^sendMsm/$',SendMsm.as_view(), name="发送短信验证"),

    url(r'^address/$', Address.as_view(), name='收货地址添加'),
    url(r'^address_list/$', AddressList.as_view(), name='收货地址列表'),

]
Esempio n. 19
0
from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from user.views import UserView, LoginView, UserhomeView, LogoutView

app_name = 'user'
urlpatterns = [
    url(r'login/', LoginView.as_view(), name='login'),
    url(r'^home/(?P<pk>\w+)/$', login_required(UserhomeView.as_view()), name="user_home"),
    url(r'^logout/$', login_required(LogoutView.as_view()), name="logout"),
    url(r'^signup/$', UserView.as_view(), name="signup"),
]
Esempio n. 20
0
    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
from user.views import index, logout, RegisterView, LoginView
from product.views import (ProductListAPI, ProductDetailAPI, ProductList,
                           ProductCreate, ProductDetail)
from order.views import OrderCreate, OrderList

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index),
    path('register/', RegisterView.as_view()),
    path('login/', LoginView.as_view()),
    path('logout/', logout),
    path('product/', ProductList.as_view()),
    path('product/create/', ProductCreate.as_view()),
    path('product/<int:pk>/', ProductDetail.as_view()),
    path('order/create/', OrderCreate.as_view()),
    path('order/', OrderList.as_view()),
    path('api/product/', ProductListAPI.as_view()),
    path('api/product/<int:pk>/', ProductDetailAPI.as_view()),
]
Esempio n. 21
0
from meeting.views import MeetRegisterView, AreasViewSet, IndexImageView, MeetAdminView, MeetRegisterAdminView, \
    MeetInformView
from user.views import AllMeetView, LoginView, UserAdminView

router = DefaultRouter()
router.register('areas', AreasViewSet, base_name='areas')
router.register('image', IndexImageView, base_name='image')
router.register('user_admin', UserAdminView, base_name='user_admin')
router.register('meet_admin', MeetAdminView, base_name='meet_admin')
router.register('meet_register_admin',
                MeetRegisterAdminView,
                base_name='meet_register_admin')

urlpatterns = [
    path('admin/', admin.site.urls),
    path('tinymce/', include('tinymce.urls')),
    path('api-auth/', include('rest_framework.urls')),
    re_path('media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
    path("api-docs/", include_docs_urls("API文档")),
    path('', include(router.urls)),
    path('admin_login/', obtain_jwt_token),
    path('all_meet/', AllMeetView.as_view({'get': 'list'})),
    path('login/', LoginView.as_view({'post': 'create'})),
    path('meet_info/',
         MeetRegisterView.as_view({
             'get': 'list',
             'post': 'create'
         })),
    path('meet/<int:pk>/', MeetInformView.as_view()),
]
Esempio n. 22
0
from django.conf.urls.static import static
from django.urls import path
from django.conf.urls import include, url
import xadmin
from hatmade.views import HatView, HatDetailView, IndexView

from hatchange.views import HatUpdateView, HatChangeAllView, UpdatelogoView, UpdatefileView
from messagereply.views import MessageReplyView
from orderflow.views import OrderFlowView
from user import views
from user.views import LoginView, LogoutView, RegisterView

urlpatterns = [
    path('xadmin/', xadmin.site.urls),
    path('hat/<good_id>', HatView.as_view(), name="hat"),
    path('login/', LoginView.as_view(), name="login"),
    path('logout/', LogoutView.as_view(), name="logout"),
    path('register/', RegisterView.as_view(), name="register"),
    path('hat_detail/<hat_id>', HatDetailView.as_view(), name="hat_detail"),
    path('alldiy/', HatChangeAllView.as_view(), name="alldiy"),
    path('update/', HatUpdateView.as_view(), name="update"),
    path('logo/', UpdatelogoView.as_view(), name="logo"),
    path('file/', UpdatefileView.as_view(), name="file"),
    path('index/', IndexView.as_view(), name="index"),
    path('flows/<update_id>', OrderFlowView.as_view(), name="flows"),
    path('messages/<update_id>', MessageReplyView.as_view(), name="messages"),
    # path('add_message/', AddUserMessageView.as_view(), name="add_message"),
    # 课程机构url配置
    url('^user_name$', views.user_name),

    # 富文本相关url
Esempio n. 23
0
from django.urls import re_path
# from user import views
from user.views import RegisterView, ActiveView, LoginView, UserInfoView, UserOrderView, AddressView, LogoutView
from django.contrib.auth.decorators import login_required
urlpatterns = [
    # re_path(r'^register$', views.register, name='register'), #注册页面
    # re_path(r'^register_handle$', views.register_handle, name='register_handle')  # 注册处理
    re_path(r'^register$', RegisterView.as_view(), name='register'),  # 注册页面
    re_path(r'^active/(?P<token>.*)$', ActiveView.as_view(),
            name='active'),  # 激活页面
    re_path(r'^login$', LoginView.as_view(), name='login'),  # 登录页面
    re_path(r'^logout$', LogoutView.as_view(), name='logout'),  # 注销登录
    re_path(r'^$', UserInfoView.as_view(), name='user'),  # 用户中心-信息页
    re_path(r'^order/(?P<page>\d+)$', UserOrderView.as_view(),
            name='order'),  # 用户中心-订单页
    re_path(r'^address$', AddressView.as_view(), name='address'),  # 用户中心-详情页
]
Esempio n. 24
0
from django.conf.urls import url
from django.urls import path, re_path
from user.views import RegisterView, ActiveView, LoginView, UserInfoView, UserInfoOrder, AddressView, LogoutView
from django.contrib.auth.decorators import login_required

urlpatterns = [
    # url(r'^register$',views.register,name='register'), # 注册
    # path('register/',views.register,name='register'), # 注册
    # path('register_handle/',views.register_handle,name='register_handle'), # 注册处理
    path('register/', RegisterView.as_view(), name='register'),  # 注册
    re_path('^active/(?P<token>.*)/$', ActiveView.as_view(),
            name='active'),  # 用户激活
    path('login', LoginView.as_view(), name='login'),  # 登录
    # re_path('^$',login_required(UserInfoView.as_view()),name='user'), # 用户中心-信息页
    # path('order',login_required(UserInfoOrder.as_view()),name='order'), # 用户中心-订单页
    # path('address',login_required(AddressView.as_view()),name='address'), # 用户中心-地址页
    re_path('^$', UserInfoView.as_view(), name='user'),  # 用户中心-信息页
    re_path('^order/(?P<page>\d+)$', UserInfoOrder.as_view(),
            name='order'),  # 用户中心-订单页
    path('address', AddressView.as_view(), name='address'),  # 用户中心-地址页
    path('logout', LoginView.as_view(), name='logout')  # 注销登录
]
Esempio n. 25
0
    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
from django.contrib import admin
from user.views import RegisterView, LoginView, CategoryView, ShopcarView, AddressView, ClothesView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    # 注册接口
    url(r'^api/(?P<version>[v1|v2]+)/register/$',
        RegisterView.as_view({'post': 'create'})),
    # 登录接口
    url(r'^api/(?P<version>[v1|v2]+)/login/$', LoginView.as_view()),
    # 分类列表页
    url(r'^api/(?P<version>[v1|v2]+)/category/$',
        CategoryView.as_view({'get': 'list'})),
    # 根据分类id 获取某个分类下的所有商品
    url(r'^api/(?P<version>[v1|v2]+)/category/(?P<pk>\d+)/$',
        CategoryView.as_view({'get': 'retrieve'}),
        name='category'),
    # 某个商品的详情
    url(r'^api/(?P<version>[v1|v2]+)/clothes/(?P<pk>\d+)/$',
        ClothesView.as_view({'get': 'retrieve'}),
        name='clothes'),
    # 添加购物车接口
    url(r'^api/(?P<version>[v1|v2]+)/addshopcar/$',
        ShopcarView.as_view({'post': 'create'}),
        name='addshopcar'),
Esempio n. 26
0
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
# from user import views
from user.views import RegisterView, ActiveView, LoginView, UserInfoView, UserOrderView, AddressView, LogoutView

urlpatterns = [
    # url(r"^register$", views.register, name="register"),  # 注册页面匹配规则
    # url(r"^register_handle$", views.register_handle, name="register_handle"),  # 注册处理
    url(r"^register$", RegisterView.as_view(),
        name="register"),  # 注册页面匹配规则,as_view方法是继承来的
    url(r"^active/(?P<token>.*)$", ActiveView.as_view(),
        name="active"),  # 用户激活
    url(r'^login$', LoginView.as_view(), name='login'),  # 登录
    url(r'^$', UserInfoView.as_view(), name='user'),  # 用户中心-信息页
    url(r'^order$', UserOrderView.as_view(), name='order'),  # 用户中心-订单页
    url(r'^address$', AddressView.as_view(), name='address'),  # 用户中心-地址页

    # url(r'^$', login_required(UserInfoView.as_view()), name='user'), # 用户中心-信息页
    # url(r'^order$', login_required(UserOrderView.as_view()), name='order'), # 用户中心-订单页
    # url(r'^address$', login_required(AddressView.as_view()), name='address'), # 用户中心-地址页
    url(r'^logout$', LogoutView.as_view(), name='logout'),  # 注销登录
]
Esempio n. 27
0
from django.conf.urls import url

from user.views import RegisterView, LoginView, MemberView, ForgetView, SendMsm, InfoView

urlpatterns = [
    url(r'^register/', RegisterView.as_view(), name='注册'),
    url(r'^login/', LoginView.as_view(), name='登录'),
    url(r'^member/', MemberView.as_view(), name='个人中心'),
    # url(r'^changepwd/', ChangePasswordView.as_view(),name='修改密码'),
    url(r'^forget/', ForgetView.as_view(), name='忘记密码'),
    url(r'^sendMsg/', SendMsm.as_view(), name='发送短信验证码'),
    url(r'^info/', InfoView.as_view(), name='个人资料'),
]
Esempio n. 28
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from main.views import HomeView
from user.views import LoginView, RegisterView, logout_view

admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^login/?$', LoginView.as_view(), name='login'),
    url(r'^register/?$', RegisterView.as_view(), name='register'),
    url(r'^logout/?$', logout_view),
    url(r'^admin/', include(admin.site.urls)),
)
Esempio n. 29
0
from rest_framework.documentation import include_docs_urls

from .settings import MEDIA_ROOT
from django.views.static import serve
from user.views import UserViewset, UserListViewSet

from rest_framework_jwt.views import obtain_jwt_token
from user.views import LoginView, UserInfoView, app_login, app_register, UserListView
from goods.views import GoodsListView
from rest_framework.routers import DefaultRouter
router = DefaultRouter()

router.register(r'user', UserViewset, base_name="user")  #用户注册接口

router.register(r'user-list', UserListViewSet, base_name="user-list")  #用户列表

urlpatterns = [
    url('admin/', admin.site.urls),
    url(r'^app/reg/$', app_register, name='app_register'),
    url(r'^app/login/$', app_login, name='app_login'),

    #jwt的认证接口
    url(r'^user/login/$', LoginView.as_view(), name='login'),  # 用户的登陆url
    url(r'^user/info/', UserInfoView, name='user-info'),  # 用户的信息url
    url(r'^user/list/$', UserListView.as_view(), name='user_list'),
    url(r'^goods/list/$', GoodsListView.as_view(), name='goods_list'),
    url(r'^', include(router.urls)),
    url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),  #文件上传
    url(r'docs/', include_docs_urls(title="果蔬电商")),  #接口文档
]
Esempio n. 30
0
urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'pinpict.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    ## administration
    url(r'^admin/', include(admin.site.urls)),

    ## site map
    url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap',
        {'sitemaps': sitemaps}),

    ## user management
    ## login
    url(r'^login/$', LoginView.as_view(), name='user_login'),

    ## logout
    url(r'^logout/$', 'user.views.logout_view', name='user_logout'),

    ## registration
    url(r'^register/$', RegistrationView.as_view(), name='user_registration'),

    ## password recovery
    url(r'^recovery/$', RecoveryView.as_view(), name='user_recovery'),
    url(r'^recovery/(?P<uuid>[-\w]+)/$', 'user.views.confirm_recovery_view', name='user_confirm_recovery'),

    ## profil
    url(r'^profil/$', login_required(ProfilView.as_view()), name='user_profil'),

    ## password changement
Esempio n. 31
0
from django.urls import path

from user.views import RegisterView, LoginView, TestView

urlpatterns = [
    path('login/', LoginView.as_view(), name='login_view'),
    path('register/', RegisterView.as_view(), name='register_view'),
    path('test/', TestView.as_view(), name='test_view'),
]