- Notifications
You must be signed in to change notification settings - Fork1
Django middleware implementing the Referrer-Policy header
License
DmytroLitvinov/django-http-referrer-policy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
django-referrer-policy provides a middleware class implementingthe Referrer-Policy header forDjango-powered sites.
Note: Starting from Django v3.0, Django itself hasdefault supportofReferrer-Policy header inSecurityMiddleware
via setting variableSECURE_REFERRER_POLICY
.
The full documentation is athttps://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:
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
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate(myenv) $ pip install tox(myenv) $ tox
Maintainable version oforiginal library.
Tools used in rendering this package:
About
Django middleware implementing the Referrer-Policy header
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.