#在index文件中
1.
print(type(request))
#看出所属库
2. 
from django.core.handlers.wsgi import  WSGIRequest
#查看WSGIRequest
发现主要的输入参数是environ
3.
print(request.environ)
#发现其是字典
4. 循环 request.environ 

5.我们要找的请求头是HTTP_USER_AGENT

print(request.environ['HTTP_USER_AGENT'])

 

posted on 2018-08-11 13:15  python我的最爱  阅读(515)  评论(0编辑  收藏  举报