Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Django middleware implementing the Referrer-Policy header

License

NotificationsYou must be signed in to change notification settings

DmytroLitvinov/django-http-referrer-policy

Repository files navigation

https://travis-ci.org/DmytroLitvinov/django-http-referrer-policy.svg?branch=masterDocumentation Status

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.

Documentation

The full documentation is athttps://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 oforiginal library.

Tools used in rendering this package:

About

Django middleware implementing the Referrer-Policy header

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp