django-http-referrer-policy provides a middleware class implementing the Referrer-Policy header for Django-powered sites.
Project description
django-referrer-policy provides a middleware class implementing the Referrer-Policy header for Django-powered sites.
Documentation
The full documentation is at https://django-http-referrer-policy.readthedocs.io.
Quickstart
Install Django HTTP Referrer Policy:
pip install django-http-referrer-policy
Add Django HTTP Referrer Policy Middleware to your settings:
MIDDLEWARE = [
...
'django_http_referrer_policy.middleware.ReferrerPolicyMiddleware',
...
]
Optional: provide variable REFERRER_POLICY to your settings with valid value if default value 'no-referrer-when-downgrade' does not suit to you:
REFERRER_POLICY = 'no-referrer'
More details about valid referrer policies: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#Syntax
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Credits
Maintainable version of original library.
Tools used in rendering this package:
History
1.1.0 (2020-10-27)
Set default value to 'no-referrer-when-downgrade' instead of requiring it
Add Django 3.1 and Python 3.9 for testing
1.0.1 (2019-08-23)
Update setup.py
Update docs for setting value in django-settings.
1.0.0 (2019-08-11)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-http-referrer-policy-1.1.0.tar.gz
.
File metadata
- Download URL: django-http-referrer-policy-1.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e753b827d6284177e011d7890345804198220537b6d56751b3a2aeda4eaa9cd7 |
|
MD5 | 87a81d05f330312c31376bd37196a54e |
|
BLAKE2b-256 | 050091a9ee127e0bcd1bd8a6bd12b1c599da32027a1b9ef5238fa81b6ddf6005 |
File details
Details for the file django_http_referrer_policy-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_http_referrer_policy-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 359ad8353a5eae02c8dd1c1a67c1c5b96dc5f416b917340c6cd6ddbf8533db54 |
|
MD5 | ad09fb13199c46947b2423f7e6cfbf3b |
|
BLAKE2b-256 | 926e3eac05c1d39569289e421c795d15f7a01881d365e6ae33d002cf2f5cb746 |