跳转到主要内容

使用Werkzeug在Thread Local Storage中存储当前请求

项目描述

这是一个从: https://github.com/sorl/django-tls 分支出来的项目。使用Werkzeug在Thread Local Storage中存储当前请求。

安装

pip install git+https://github.com/rvanlaar/django-tls

配置

 # settings.py
 MIDDLEWARE = [
     'tls.TLSRequestMiddleware',
     ...
]

使用

from tls import request
# do something dangerous and useful with current request object

担心安全问题?那么请阅读这个 线程

由以下组织支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面