Django设置路由

from ui import views as ui_view
from django.conf.urls import url

urlpatterns = [
    # path('admin/', admin.site.urls),
    url(r'^$', ui_view.home, name='home'),  # 首页
    url(r'^menu1$', ui_view.menu1, name='menu1'),  # 首页
    url(r'^sendKafka', ui_view.sendKafka, name='sendKafka'),  # 首页
    url(r'^uploadFile', ui_view.uploadFile, name='uploadFile'),  # 首页
    url(r'^getselect', ui_view.getselect, name='getselect'),  # 首页
    url(r'^table', ui_view.table, name='table'),  # 首页
]

  按照上述方式设置好路由后,对应的接口路径会跳到对应视图的函数中进行数据处理

posted @ 2022-04-16 15:02  James_Danni  阅读(107)  评论(0编辑  收藏  举报