Django下实现:
urls.py:
from django.conf.urls import urlfrom django.contrib import adminfrom app01 import viewsurlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^index/', views.index), url(r'^pop/', views.pop),]
app01.views.py
from django.shortcuts import renderdef index(request): return render(request,'index.html')def pop(request): if request.method == "GET": return render(request, 'pop.html') else: user = request.POST.get('user') #这里可以有数据库操作 return render(request,'pop_response.html',{'user':user})
templates.index.html
Title 无所谓
点我点我
templates.pop.html
Title
templates.pop_response.html
Title 正在关闭