本网站可以通过分类标签帮助你快速筛选出你想看的文章,记住地址:www.Facec.cc

Django全局url.py配置模板

# 总url.py
from django.contrib import admin
from django.urls import path, include, re_path
from django.views import static
from django.conf import settings

import videoservice
import users
import content
import pay
import tools.email
from .data_visuailzation import chartProductSales, SalesChart

urlpatterns = [
    # 静态文件存储
    re_path(r'^nginx_static/(?P<path>.*)$', static.serve, {'document_root': str(settings.STATIC_ROOT)}, name='static'),
    re_path(r'^media/(?P<path>.*)$', static.serve, {'document_root': str(settings.MEDIA_ROOT)}),

    # 注册api服务
    path('houtai/', admin.site.urls),
    # path('user/', include(("users.urls", "userform"), namespace="userform")),
    path('user/', include("users.urls", namespace="userform")),
    path('content/', include("content.urls", namespace="contentform")),
    path('videoservice/', include("videoservice.urls", namespace="videoserviceform")),
    path('pay/', include("pay.urls", namespace="payform")),
    path('productsales/', chartProductSales),  # 柱状图售卖个数
    path('saleschart/', SalesChart),  # 线性图售卖金额
]


# content/url.py

from django.contrib import admin
from django.urls import path, include
from .views import *

app_name = 'contentform'
urlpatterns = [

    path('getindexad/', getIndexAd),  # 首页广告
    path('getproduct/', getProduct),  # 获取所有产品
    path('getAllProduct/', getAllProduct),  # 获取所有产品(带分类


    path('getproductad/', getProductAd),  # 获取首页产品广告
    path('getproductad2/', getProductAd2),  # 获取首页产品广告
    path('getzhentidictlist/', getZhentiDictList.as_view()),
    path('getarticlebypage/', getArticleByPage.as_view()),  #
    path('getproductbyid/', getProductById),  #
    path('getarticlebyid/', getArticleById.as_view()),  #
    path('getzhenticategorybyid/', getZhentiCategoryById),  #
    path('getzhentilistbyzhenticategoryid/', getZhentiListByZhentiCategory_id),  # 获取真题列表
    path('getzhentibyid/', getZhentiById),  # 获取真题列表
    path('goWenjuan/', goWenjuan),  # 获取真题列表
    path('serchRobotMessage/', serchRobotMessage),  # 获取
    path('getRobotMessageById/', getRobotMessageById),  # 获取
    path('getAllShangangushi/', getAllShangangushi),  # 上岸故事
    path('getShangangushiById/', getShangangushiById),  # 上岸故事文章详情
    path('getShangangushiByCategory/', getShangangushiByCategory),  # 上岸故事文章详情
    path('getWangNianZhenTisByYear/', getWangNianZhenTisByYear),  # 往年真题
    path('getWangNianZhenTiById/', getWangNianZhenTiById),  # 往年真题
]


# django  

评论