【发布时间】:2023-01-05 01:26:46
【问题描述】:
我尝试使用反向,django 中没有问题,当我看到响应时它只是空白
from django.shortcuts import render
from django.http import HttpRequest
from django.http import HttpResponse
from django.http import JsonResponse
from django.shortcuts import redirect
def Aviation (request):
return render(request, 'Aviation/Aviationtest.html')
def SendInformations (request):
#a lot of uninteresting code
return redirect(reverse("Aviation"))
这是我的 urls.py 文件
from django.urls import path
from . import views
urlpatterns = [
path("", views.Aviation, name="Aviation"),
path("let_me_send_informations", views.let_me_send_informations, name="let_me_send_informations"),
path("Informations", views.Informations, name="Informations"),
path("SendInformations", views.SendInformations, name="SendInformations")
]
我尝试使用反向,完整路径,而不是使用反向,我确信目录设置得很好
【问题讨论】: