secure.py¶
secure.py 🔒 is a lightweight package that adds optional security headers and cookie attributes for Python web frameworks.
Supported Python web frameworks:¶
aiohttp, Bottle, CherryPy, Django, Falcon, Flask, hug, Masonite, Pyramid, Quart, Responder, Sanic, Starlette, Tornado
Install¶
pip:
$ pip install secure
Pipenv:
$ pipenv install secure
After installing secure.py:
from secure import SecureHeaders, SecureCookie
secure_headers = SecureHeaders()
secure_cookie = SecureCookie()