Skip to main content

Django HTTP Referrer Policy

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.

Note: Starting from Django v3.0, Django itself has default support

of Referrer-Policy header in SecurityMiddleware via setting variable SECURE_REFERRER_POLICY.

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.1 (2020-11-02)

  • Add deprecation warning about Django v3.0. Django itself has default support of Referrer-Policy header in SecurityMiddleware via setting variable SECURE_REFERRER_POLICY.

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.

Metadata

Release files for django-http-referrer-policy 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-http-referrer-policy 1.1.1
File Size Uploaded Provenance Actions
django-http-referrer-policy-1.1.1.tar.gz 6.9 kB Without provenance Details for django-http-referrer-policy-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-http-referrer-policy 1.1.1
File Interpreter ABI Platform Actions
django_http_referrer_policy-1.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for django_http_referrer_policy-1.1.1-py2.py3-none-any.whl

Total release size: 12.4 kB

Release files / django-http-referrer-policy-1.1.1.tar.gz

Download URL django-http-referrer-policy-1.1.1.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
917f5ed62054b27eff3172b7eccfb018469e85ddd538767328553282a70493c3
BLAKE2b-256 checksum
How to use checksums
c42a31a94b1f634a8843a3e879fbb988a3ebbff7927face4768249dff8059198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release files / django_http_referrer_policy-1.1.1-py2.py3-none-any.whl

Download URL django_http_referrer_policy-1.1.1-py2.py3-none-any.whl
Size 5.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7617d1256f1ab80c1a12bffdd8c8d24b94093eb1e21d035e2aa6d7d3c5ac999e
BLAKE2b-256 checksum
How to use checksums
368e1e8b96d8c9722d87d71a8542d7d2dfde6816cb15693e67e40208e0f76bd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Security for django-http-referrer-policy 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page