当前位置: 代码迷 >> 综合 >> Django 首页设置 通过路由
  详细解决方案

Django 首页设置 通过路由

热度:14   发布时间:2024-02-11 01:27:12.0
from django.urls import path,re_path
from . import mqtt_clienturlpatterns = [path('index/', mqtt_client.index),path('mqtt_client/', mqtt_client.mqtt_client),re_path(r'^$',mqtt_client.index) #路由设置首页
]

re_path(r'^$',mqtt_client.index) #路由设置首页 必须要放在url的最后面