Exemplo n.º 1
0
from django.contrib import admin
from django.urls import path, include
from users.views import LoginView, RegisterView, SendEmailView
from goods.views import GoodsView, PriceView, GoodsListView

urlpatterns = [
    path('', LoginView.as_view(), name='login'),
    path('admin/', admin.site.urls),
    path('buy/', GoodsView.as_view(), name='buy'),
    path('price/', PriceView.as_view(), name='price'),
    path('goodsList/', GoodsListView.as_view(), name='goodsList'),
    path('login/', LoginView.as_view(), name='login'),
    path('register/', RegisterView.as_view(), name='register'),
    path('send_email/', SendEmailView.as_view(), name='send_email'),
    path('captcha/', include('captcha.urls')),
]
Exemplo n.º 2
0
from django.contrib import admin
from django.conf.urls import url
from django.contrib.auth.decorators import permission_required

from goods.views import GoodsListView, GoodDetailView, GoodCreate, GoodUpdate, GoodDelete

urlpatterns = [
    url(r'^(?P<pk>\d+)/$', GoodsListView.as_view(), name="goods_index"),
    url(r'^(?P<pk>\d+)/detail/$',
        GoodDetailView.as_view(),
        name="goods_detail"),
    url(r'^(?P<pk>\d+)/add/$',
        permission_required("goods.add_good")(GoodCreate.as_view()),
        name="goods_add"),
    url(r'^(?P<pk>\d+)/edit/$',
        permission_required("goods.change_good")(GoodUpdate.as_view()),
        name="goods_edit"),
    url(r'^(?P<pk>\d+)/delete/$',
        permission_required("goods.delete_good")(GoodDelete.as_view()),
        name="goods_delete"),
]
Exemplo n.º 3
0
from django.conf.urls import url
from goods.views import IndexView, GoodsDetailView, GoodsListView

urlpatterns = [
    url(r'^$', IndexView.as_view(), name='index'),  # 首页
    url(r'^goods/(?P<goods_id>\d+)$', GoodsDetailView.as_view(),
        name='detail'),  # 商品详情页
    url(r'^goods/(?P<type_id>\d+)/(?P<page>\d+)$',
        GoodsListView.as_view(),
        name='list'),  # 商品分类列表页
]
Exemplo n.º 4
0
"""MxShop URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    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
import xadmin
from MxShop.settings import MEDIA_ROOT
from django.views.static import serve
from rest_framework.documentation import include_docs_urls

from goods.views import GoodsListView

urlpatterns = [
    url(r'^admin/', xadmin.site.urls),
    url(r'^api-auth/', include('rest_framework.urls')),
    url(r'^media/(?P<path>.*)$', serve, {'document_root': MEDIA_ROOT}),
    url(r'^goods/$', GoodsListView.as_view(), name='goods-list'),  # 商品列表
    url(r'^docs/', include_docs_urls(title='生鲜'))
]
Exemplo n.º 5
0
from django.conf.urls import url
from goods.views import GoodsListView, GoodDetailView, change_view

urlpatterns = [
    url(r'(?P<pk>\d+)/$', GoodsListView.as_view(), name='goods'),
    url(r'(?P<pk>\d+)/detail/$', GoodDetailView.as_view(),
        name='goods_detail'),
    url(r'change_view/$', change_view, name='change_view'),
]
Exemplo n.º 6
0
Arquivo: urls.py Projeto: acshana/shop
from rest_framework.documentation import include_docs_urls
from goods.views_base import GoodsListView as good1
from goods.views import GoodsListView as good2
from goods.generics_views import GoodsListView as good3
from goods.sets_views import GoodsListView as good4
from rest_framework.routers import DefaultRouter
# from django.contrib import admin

router=DefaultRouter()
router.register(r'goods5',good4)

goods_list = good4.as_view({
    'get': 'list',
    'post': 'create'
})

urlpatterns = [
    # url(r'^admin/', admin.site.urls),
    url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),  # 使图片正确显示
    url(r'^api-auth/', include('rest_framework.urls')),

    # 商品列表
    url(r'^goods1/$', good1.as_view(), name="goods-list1"),
    url(r'^goods2/$', good2.as_view(), name="goods-list2"),
    url(r'^goods3/$', good3.as_view(), name="goods-list3"),
    url(r'^goods4/$', goods_list, name="goods-list4"),
    url(r'^', include(router.urls)),

    url(r'^docs/', include_docs_urls(title='shop文档')),
]
Exemplo n.º 7
0
    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 django.conf.urls import url
from django.views.static import serve
import xadmin

from django.urls import path, re_path, include
from django.views.generic import TemplateView
from MxShop.settings import MEDIA_ROOT
from rest_framework.documentation import include_docs_urls

from goods.views import GoodsListView

urlpatterns = [
    # path('admin/', admin.site.urls),
    path('xadmin/', xadmin.site.urls),
    # 处理图片显示的url,使用Django自带serve,传入参数告诉它去哪个路径找,我们有配置好的路径MEDIAROOT
    re_path('media/(?P<path>.*)', serve, {"document_root": MEDIA_ROOT}),
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),
    # url(r'^xadmin', xadmin.site.urls)
    # 富文本相关url
    path('ueditor/', include('DjangoUeditor.urls')),
    # 商品列表页
    url(r'goods/$', GoodsListView.as_view(), name="goods-list"),
    path('docs/', include_docs_urls(title="生鲜文档"))
]
Exemplo n.º 8
0
# 配置goods的url
router.register(r'goods1', GoodsListViewSet, base_name='goods')
router.register(r'categorys', CategoryViewset, base_name='cagetory')
router.register(r'hotsearchs', HotSearchsViewset, base_name='hotsearch')
router.register(r'banners', BannerViewset, base_name='banner')
router.register(r'indexgoods', IndexCategoryViewset, base_name='index')
router.register(r'users', UserViewset, base_name="users")
router.register(r'sms', SmsCodeViewset, base_name="sms")
router.register(r'userfavs', UserFavViewset, base_name="userfavs")
router.register(r'messages', LeavingMessageViewset, base_name="messages")
router.register(r'address', AddressViewset, base_name="address")
router.register(r'shopcarts', ShoppingCartViewset, base_name="shopcarts")
router.register(r'orders', OrderViewset, base_name="orders")

urlpatterns = [
    url(r'^', include(router.urls)),
    # url(r'^api/', include(router.urls, namespace='api')),
    url(r'^index/', index, name='index'),
    url(r'^xadmin/', xadmin.site.urls),
    # url(r'^goods/', GoodsListView.as_view(), name='goods_list')
    url(r'^goods/', GoodsListView.as_view(), name='goods_list'),
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),
    url(r'^api-token-auth/', views.obtain_auth_token),
    # url(r'^jwt-auth/', obtain_jwt_token),
    url(r'^login/', obtain_jwt_token),
    url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
    url(r'docs/', include_docs_urls(title='MxShop'))
]
Exemplo n.º 9
0
    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.conf.urls import url, include
import xadmin
from MxShop.settings import MEDIA_ROOT
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from goods.views import GoodsListView
urlpatterns = [
    url(r"^xadmin/", xadmin.site.urls),
    url(r"api-auth/", include("rest_framework.urls", namespace="rest_framework")),
    url(r"^media/(?P<path>.*)$", serve, {"document_root": MEDIA_ROOT}),

    # 商品列表页
    url(r"goods/$", GoodsListView.as_view(), name="goods-list"),

    url(r"docs/$", include_docs_urls(title="幕学生鲜")),

]
Exemplo n.º 10
0
from django.conf.urls import url
from goods.views import GoodsListView

urlpatterns = [url(r'list/', GoodsListView.as_view(), name='list')]
Exemplo n.º 11
0
import xadmin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static

from goods.views import AutoFollowView
from goods.views import GoodsListView, GoodsSpiderView, ModifyGoodsView, SingleGoodsListView
from order.views import OrderListView, IndexView, OrderSpiderView, BuyGoodsView, ModifyPurchaseView
from order.views import StockView, StockListView, OrderChartsView, OrderInfoView, OrderWaybillView
from order.views import BaleOrderView, CheckIncomeView, CheckOrderView

urlpatterns = [
    # path('admin/', admin.site.urls),
    path('xadmin/', xadmin.site.urls),

    path('goods/list/', GoodsListView.as_view(), name='goods_list'),                # 商品列表 get页面 post数据
    path('modify/good/', ModifyGoodsView.as_view(), name='modify_good'),            # 修改商品数据
    path('goodsku/list/', SingleGoodsListView.as_view(), name='goodsku_list'),      # 单个spu商品 sku列表

    path('order/list/', OrderListView.as_view(), name='order_list'),                # 已完成订单列表 get页面 post数据
    path('order/info/', OrderInfoView.as_view(), name='order_info'),                # 已完成订单详情 修改订单备注信息
    path('order/charts/data', OrderChartsView.as_view(), name='charts_data'),       # 订单统计 图表数据

    path('buy/product/', BuyGoodsView.as_view(), name='buy_product'),               # 采购单列表 创建
    path('modify/purchase/', ModifyPurchaseView.as_view(), name='modify_purchase'), # 采购单修改

    path('finished/purchase/', StockView.as_view(), name='finished_purchase'),      # 入库操作
    path('purchase/list/', StockListView.as_view(), name='purchase_list'),          # 入库单列表 get页面 post数据

    path('get/product/', GoodsSpiderView.as_view(), name='get_product'),            # 抓取商品信息
    path('get/order/', OrderSpiderView.as_view(), name='get_order'),                # 抓取订单信息
Exemplo n.º 12
0
# -*- coding: utf-8 -*-
"""
@author: hanfeng.lin
@contact: wahaha
@Created on: 2020/4/14 9:38
"""
from django.urls import path, re_path

from goods.views import IndexView, GoodsDetailView, GoodsListView

urlpatterns = [
    path('index', IndexView.as_view(), name='index'),
    path('goods/<int:goods_id>', GoodsDetailView.as_view(), name='detail'),
    path('list/<int:type_id>/<int:page>', GoodsListView.as_view(),
         name='list'),
]
Exemplo n.º 13
0
# from django.contrib import admin
import xadmin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static

from goods.views import AutoFollowView
from goods.views import GoodsListView, GoodsSpiderView, ModifyGoodsView, SingleGoodsListView
from order.views import OrderListView, IndexView, OrderSpiderView, BuyGoodsView, ModifyPurchaseView
from order.views import StockView, StockListView, OrderChartsView, OrderInfoView, OrderWaybillView
from order.views import BaleOrderView, CheckIncomeView

urlpatterns = [
    # path('admin/', admin.site.urls),
    path('xadmin/', xadmin.site.urls),
    path('goods/list/', GoodsListView.as_view(),
         name='goods_list'),  # 商品列表 get页面 post数据
    path('modify/good/', ModifyGoodsView.as_view(),
         name='modify_good'),  # 修改商品数据
    path('goodsku/list/', SingleGoodsListView.as_view(),
         name='goodsku_list'),  # 单个spu商品 sku列表
    path('order/list/', OrderListView.as_view(),
         name='order_list'),  # 已完成订单列表 get页面 post数据
    path('order/info/', OrderInfoView.as_view(),
         name='order_info'),  # 已完成订单详情 修改订单备注信息
    path('order/charts/data', OrderChartsView.as_view(),
         name='charts_data'),  # 订单统计 图表数据
    path('buy/product/', BuyGoodsView.as_view(),
         name='buy_product'),  # 采购单列表 创建
    path('modify/purchase/',
         ModifyPurchaseView.as_view(),
Exemplo n.º 14
0
router = DefaultRouter()
router.register(r'goods', GoodsListView, base_name="goods")
router.register(r'categories', CategoryViewSet, base_name="categories")
router.register(r'code', SmsCodeViewSet, base_name="code")
router.register(r'users', UserViewSet, base_name="users")
router.register(r'userfavs', UserFavViewSet, base_name="userfavs")
router.register(r'messages', LeavingMessageViewSet, base_name="messages")
router.register(r'address', AddressViewSet, base_name="address")
router.register(r'shopcarts', ShoppingCartViewSet, base_name="shopcarts")
router.register(r'orders', OrderViewSet, base_name="orders")
router.register(r'banners', BannerViewSet, base_name="banners")
router.register(r'hotsearchs', HotSearchsViewSet, base_name="hotsearchs")
router.register(r'indexgoods', IndexCategoryViewset, base_name="indexgoods")

goods_list = GoodsListView.as_view({
    'get': 'list'
})

urlpatterns = [
    path('media/<path:path>', serve, {'document_root': MEDIA_ROOT}),
    path('ueditor/', include('DjangoUeditor.urls')),
    path('xadmin/', xadmin.site.urls),
    path('api-auth/', include('rest_framework.urls')),
    path('docs/', include_docs_urls(title="美客生鲜")),
    # drf自带的token认证模式
    path('api-token-auth/', views.obtain_auth_token),
    # jwt的认证模式
    path('login/', obtain_jwt_token),
    path('', include(router.urls)),
    path('alipay/return/', AlipayView.as_view(), name="alipay"),
]
Exemplo n.º 15
0
# coding: utf-8
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import permission_required

from goods.views import GoodsListView, GoodDetailView, GoodCreate, GoodUpdate, GoodDelete, RssGoodsListFeed, AtomGoodsListFeed

urlpatterns = patterns('',
  url(r'^(?P<pk>\d+)/$', GoodsListView.as_view(), name = "goods_index"),
  url(r'^(?P<pk>\d+)/detail/$', GoodDetailView.as_view(), name = "goods_detail"),
  url(r'^(?P<pk>\d+)/add/$', permission_required("goods.add_good")(GoodCreate.as_view()), name = "goods_add"),
  url(r'^(?P<pk>\d+)/edit/$', permission_required("goods.change_good")(GoodUpdate.as_view()), name = "goods_edit"),
  url(r'^(?P<pk>\d+)/delete/$', permission_required("goods.delete_good")(GoodDelete.as_view()), name = "goods_delete"),
  url(r'^(?P<pk>\d+)/feed/rss/$', RssGoodsListFeed(), name = "goods_feed_rss"),
  url(r'^(?P<pk>\d+)/feed/atom/$', AtomGoodsListFeed(), name = "goods_feed_atom"),
)
Exemplo n.º 16
0
from django.conf.urls import url, include
from Shop.settings import MEDIA_ROOT
from django.views.static import serve
from rest_framework.documentation import include_docs_urls
from goods.views_base import GoodsListView as good1
from goods.views import GoodsListView as good2
from goods.generics_views import GoodsListView as good3
from goods.sets_views import GoodsListView as good4
from rest_framework.routers import DefaultRouter
# from django.contrib import admin

router = DefaultRouter()
router.register(r'goods5', good4)

goods_list = good4.as_view({'get': 'list', 'post': 'create'})

urlpatterns = [
    # url(r'^admin/', admin.site.urls),
    url(r'^media/(?P<path>.*)$', serve,
        {"document_root": MEDIA_ROOT}),  # 使图片正确显示
    url(r'^api-auth/', include('rest_framework.urls')),

    # 商品列表
    url(r'^goods1/$', good1.as_view(), name="goods-list1"),
    url(r'^goods2/$', good2.as_view(), name="goods-list2"),
    url(r'^goods3/$', good3.as_view(), name="goods-list3"),
    url(r'^goods4/$', goods_list, name="goods-list4"),
    url(r'^', include(router.urls)),
    url(r'^docs/', include_docs_urls(title='shop文档')),
]
Exemplo n.º 17
0
from goods.views import GoodsListView,GoodsListSearch,CategoryViewSet, ParentCategoryViewSet,BannerViewSet,\
    IndexCategoryGoodsViewSet,GoodsdetailView,GoodsSearchView

router = DefaultRouter()  #router的作用就是将viewset对象的url映射关系提取出来
#将定义的View方法提取出来
router.register(r'GoodsListSearch',
                GoodsListSearch,
                basename='GoodsListSearch')  #商品简要信息列表
router.register(r'CategoryViewSet',
                CategoryViewSet,
                basename='SearchAllDateViewSet')  #商品分类
router.register(r'ParentCategoryViewSet',
                ParentCategoryViewSet,
                basename='MapModelAllDateViewSet')  #
router.register(r'BannerViewSet', BannerViewSet, basename='BannerView')  #轮播图
router.register(r'IndexCategoryGoodsViewSet',
                IndexCategoryGoodsViewSet,
                basename='RegistrationAllDataViewSet')
router.register(r'GoodsdetailView',
                GoodsdetailView,
                basename='GoodsdetailView')  #商品详情
router.register(r'GoodsSearch', GoodsSearchView,
                basename='GoodsSearchView')  #商品搜索

urlpatterns = [
    url(r'^', include(router.urls)),  #显示所有的urls概览也就是显示下面这个的框框
    url(r'^GoodsListView/$', GoodsListView.as_view(),
        name='GoodsListView'),  # 商品详情
    #as_view()用于注册没有view_set的视图  即传入参数中没有viewsets.GenericViewSet
]
Exemplo n.º 18
0
#:将创建一个读/写API,来处理我们项目中的用户信息

from ETC.api import views
from ETC.api.views import *
from django.conf.urls import include
from rest_framework import routers

router = DefaultRouter()
router.register(r'goods', GoodsListViewSet)

#router.register(r'categorys', CategoryViewSet, base_name="categorys")

router = routers.DefaultRouter(trailing_slash=True)
#router.register(r'', UploadImageViewSet, base_name='UploadFile')

urlpatterns = [
    #    path('admin/', admin.site.urls),
    path('xadmin/', xadmin.site.urls),
    path(r'^ueditor/', include('DjangoUeditor.urls')),
    #: 配置上传文件的访问处理函数
    path('media/<path:path>', serve, {'document_root': MEDIA_ROOT}),

    #:
    path('docs', include_docs_urls(title='意艺品')),
    path('api-auth/', include('rest_framework.urls',
                              namespace='rest_framework')),
    path('goods', GoodsListView.as_view(), name="goods-list"),
    path('', include(router.urls)),
    #   path(r'^snippets/$', include('snippets.api.urls', namespace='snippets')),
]