Skip to main content

django-http-referrer-policy provides a middleware class implementing the Referrer-Policy header for Django-powered sites.

Project description

https://badge.fury.io/py/django-http-referrer-policy.svg https://travis-ci.org/DmytroLitvinov/django-http-referrer-policy.svg?branch=master Documentation Status https://codecov.io/gh/DmytroLitvinov/django-http-referrer-policy/branch/master/graph/badge.svg

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

django-http-referrer-policy-1.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

django_http_referrer_policy-1.1.0-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-http-referrer-policy-1.1.0.tar.gz.

File metadata

File hashes

Hashes for django-http-referrer-policy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e753b827d6284177e011d7890345804198220537b6d56751b3a2aeda4eaa9cd7
MD5 87a81d05f330312c31376bd37196a54e
BLAKE2b-256 050091a9ee127e0bcd1bd8a6bd12b1c599da32027a1b9ef5238fa81b6ddf6005

See more details on using hashes here.

File details

Details for the file django_http_referrer_policy-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_http_referrer_policy-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 359ad8353a5eae02c8dd1c1a67c1c5b96dc5f416b917340c6cd6ddbf8533db54
MD5 ad09fb13199c46947b2423f7e6cfbf3b
BLAKE2b-256 926e3eac05c1d39569289e421c795d15f7a01881d365e6ae33d002cf2f5cb746

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page