在View.py中写一个方法
列如:
#搜索页面 type = None def detail(requests): global type type = requests.GET['type'] if requests.GET.get('pagenum')==None: pagenum = 1 else: pagenums = requests.GET['pagenum'] item = vsql.gettable(type, pagenum) context={'item':item} # print context return render(requests, "sousuo.html", context)在html中的链接: < a href= "detail?type=mz" > 美妆 a >