效果:在p1.html页面点击,弹出p2的弹出框,填写数据,在 popup_response页面处理数据
1、视图函数:views.py
from django.shortcuts import render
def p1(request):
return render(request,"p1.html")
def p2(request):
if request.method == "GET":
return render(request,"p2.html")
elif request.method == "POST":
city =request.POST.get("city")
print(city)
return render(request,"popup_response.html",{
"city":city}
2、前端页面及函数
p1.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta