
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
django-http-referrer-policy
Advanced tools
django-http-referrer-policy provides a middleware class implementing the Referrer-Policy header for Django-powered sites.
.. image:: https://badge.fury.io/py/django-http-referrer-policy.svg :target: https://badge.fury.io/py/django-http-referrer-policy
.. image:: https://travis-ci.org/DmytroLitvinov/django-http-referrer-policy.svg?branch=master :target: https://travis-ci.org/DmytroLitvinov/django-http-referrer-policy
.. image:: https://readthedocs.org/projects/django-http-referrer-policy/badge/?version=latest :target: https://django-http-referrer-policy.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://codecov.io/gh/DmytroLitvinov/django-http-referrer-policy/branch/master/graph/badge.svg :target: https://codecov.io/gh/DmytroLitvinov/django-http-referrer-policy
django-referrer-policy provides a middleware class implementing the Referrer-Policy header <https://www.w3.org/TR/referrer-policy/>
_ for
Django <https://www.djangoproject.com/>
_-powered sites.
Note: Starting from Django v3.0, Django itself has default support <https://docs.djangoproject.com/en/3.0/ref/middleware/#referrer-policy>
_
of Referrer-Policy header in SecurityMiddleware
via setting variable SECURE_REFERRER_POLICY
.
The full documentation is at https://django-http-referrer-policy.readthedocs.io.
Install Django HTTP Referrer Policy::
pip install django-http-referrer-policy
Add Django HTTP Referrer Policy Middleware to your settings:
.. code-block:: python
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:
.. code-block:: python
REFERRER_POLICY = 'no-referrer'
More details about valid referrer policies: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#Syntax
Does the code actually work?
::
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox
Maintainable version of original library <https://github.com/ubernostrum/django-referrer-policy/>
_.
Tools used in rendering this package:
cookiecutter-djangopackage
_.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _cookiecutter-djangopackage
: https://github.com/pydanny/cookiecutter-djangopackage
.. _origin library
: https://google.com
1.1.1 (2020-11-02) ++++++++++++++++++
default support <https://docs.djangoproject.com/en/3.0/ref/middleware/#referrer-policy>
_ of Referrer-Policy header in SecurityMiddleware
via setting variable SECURE_REFERRER_POLICY
.1.1.0 (2020-10-27) ++++++++++++++++++
'no-referrer-when-downgrade'
instead of requiring it1.0.1 (2019-08-23) ++++++++++++++++++
1.0.0 (2019-08-11) ++++++++++++++++++
FAQs
django-http-referrer-policy provides a middleware class implementing the Referrer-Policy header for Django-powered sites.
We found that django-http-referrer-policy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.