根url
urlpatterns = [ path('', include('root.urls')), ]
root应用url
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), ]
views
def index(request): return redirect('路由')