djangoframework获取request的参数
作者:
ljwheyxy | 来源:发表于
2019-11-04 11:11 被阅读0次
查看所有参数
from django.core.handlers.wsgi import WSGIRequest
def test(request):
print(type(request)) # 打印出request的类型
print(request.environ) # 打印出request的header详细信息
# 循环打印出每一个键值对
for k, v in request.environ.items():
print(k, v)
获取请求参数
Django URL常用模式匹配大全
POST GET获取
def filter_books(objects, request):
filter_author = request.POST['author']
if (filter_author):
objects = objects.filter(author__icontains=filter_author)
return objects
本文标题:djangoframework获取request的参数
本文链接:https://www.haomeiwen.com/subject/niyrbctx.html
网友评论