django中怎么设置链接,并自动刷新,调用写的方法

在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 >

猜你喜欢

转载自blog.csdn.net/Como0413/article/details/80268095
今日推荐