Пример #1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
@Author  :   {ling}
@Time    :   2021/4/8- 14:34
'''
from django.urls import re_path
from apps.user.views import Register, Active, Login, Logout, UserInfo, UserOrder, UserAddress

urlpatterns = [
    re_path('^register/$', Register.as_view(), name='register'),
    re_path('^active/(?P<token>.*)/$', Active.as_view(), name='active'),
    re_path('^login/$', Login.as_view(), name='login'),
    re_path('^logout/$', Logout.as_view(), name='logout'),
    re_path('^$', UserInfo.as_view(), name='user'),
    re_path('^order/(?P<page>\d+)/$', UserOrder.as_view(), name='order'),
    re_path('^address/$', UserAddress.as_view(), name='address'),
]
Пример #2
0
urlpatterns = [

    #path('admins/', admin.site.urls),
    path('admin/', TemplateView.as_view(template_name='admin/index.html')),
   # path('404/', TemplateView.as_view(template_name='500.html')),
    # path('',test), # 这是生成验证码的图片
    url(r'^captcha/', include('captcha.urls')),
    path('refresh/', captcha_refresh),  # 这是生成验证码的图片
    path('yan/', yan),  # 这是生成验证码的图片
    path('', views.Home, name='home'),
    path('webapp/', TemplateView.as_view(template_name='webapp/index.html')),
    path('login/', login_view, name='index'),
    path('info/', get_message, name='info'),
    path('person/', include('apps.user.urls')),
    path('logou/', logout_view, name='logou'),
    path('register/', Register.as_view(), name='register'),
    path('article/', include('apps.article.urls')),
    path('course/', include('apps.course.urls')),
    path('support/', include('apps.support.urls')),
    path('forum/', include('apps.forum.urls')),
    path('ads.txt/',TemplateView.as_view(template_name='ads.txt')),
    path('root.txt/', TemplateView.as_view(template_name='root.txt')),
    path('jd_root.txt/', TemplateView.as_view(template_name='jd_root.txt')),
    path('gome_20943.txt/', TemplateView.as_view(template_name='gome_20943.txt')),
    #url(r'^activate/(?P<token>\w+.[-_\w]*\w+.[-_\w]*\w+)/$', active_user, name='active_user'),
    path('activate/<str:token>', active_user, name='active_user'),
    url(r'^search/', include('haystack.urls'), name='haystack_search'),

    re_path(r'^upload/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),
    url(r'api/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
Пример #3
0
from django.conf.urls import url
from apps.user.views import Index, Login, Register, Logout
urlpatterns = [
    url(r'^$', Index.as_view()),
    url(r'^login/$', Login.as_view()),
    url(r'^register/$', Register.as_view()),
    url(r'^logout/', Logout.as_view()),
]
Пример #4
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.contrib import admin
from apps.user.views import Register, Login, Forget
from apps.user.views import logout, get_geetest, update_pass, get_city
from apps.goods.views import Index

urlpatterns = [
    url(r'^admin/', admin.site.urls),  # 管理后台
    url(r'^tinymce/', include('tinymce.urls')),  # 富文本编辑器
    url(r'^search/', include('haystack.urls')),  # 搜索引擎
    url(r'^register$', Register.as_view(), name='register'),  # 注册
    url(r'^login$', Login.as_view(), name='login'),  # 登录
    url(r'^forget$', Forget.as_view(), name='forget'),  # 忘记密码
    url(r'^update_pass$', update_pass, name='update_pass'),  # 修改密码
    url(r'^logout$', logout, name='logout'),  # 注销
    url(r'^user/', include('apps.user.urls', namespace='user')),
    url(r'^cart/', include('apps.cart.urls', namespace='cart')),
    url(r'^goods/', include('apps.goods.urls', namespace='goods')),
    url(r'^order/', include('apps.order.urls', namespace='order')),
    url(r'^index$', Index.as_view(), name='index'),  # 首页
    url(r'^get_city(?P<city_id>\d+)$', get_city, name='get_city'),  # 获取城市
    # 极验滑动验证码 获取验证码的url
    url(r'^pc-geetest/register', get_geetest),
]
Пример #5
0
from django.conf.urls import url
from apps.user.views import Register, Active, Login, ProductionShow, Logout, Address
from django.contrib.auth.decorators import login_required

urlpatterns = [

    # url(r'^registers/$',views.register,name='registers'),
    # url(r'^register_handler$',views.register_handle)
    url(r'register/', Register.as_view(), name='register'),
    url(r'login/', Login.as_view(), name='login'),
    url(r'^active/(?P<active_info>.*)', Active.as_view(), name='active'),
    url(r'production/',
        login_required(ProductionShow.as_view()),
        name='production'),
    url(r'logout/', Logout.as_view(), name='logout'),
    url(r'address/', Address.as_view(), name='address')
]