重定向

根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('路由')

 

posted @ 2024-01-05 19:33  半日闲1  阅读(4)  评论(0编辑  收藏  举报