Flask-NoFLoC sends the header Permissions-Policy: interest-cohort=() with each request to opt websites out of FLoC. See https://plausible.io/blog/google-floc#how-to-opt-out-of-floc-as-a-web-developer-set-a-permissions-policy for more information.
Project description
Flask-NoFLoC is a Flask extension which disables FLoC by adding the header
Permissions-Policy: interest-cohort=()
to each HTTP response of your app. Documentation
To set it up, follow the usual Flask extension setup, either directly:
from flask import Flask
from flask_nofloc import NoFLoC
app = Flask(__name__)
NoFLoC(app)
or using the init_app-paradigm:
# extensions.py
from flask_noflock import NoFLoC
nofloc = NoFLoC()
# app.py
from flask import Flask
from extensions import nofloc
def create_app(settings):
app = Flask('myapp')
nofloc.init_app(app)
return app
If you only want to exclude specific route, you can use a decorator:
from flask_nofloc import add_nofloc_header
@app.route('/nofloc')
@add_nofloc_header
def no_floc():
return 'no FLoC'
Install via pip and your favorite installation method:
pip install Flask-NoFLoC
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Flask-NoFLoC-1.0.0.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for Flask_NoFLoC-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edf5b7e7d7b0341198b92dcc29fba758d76b2af668284d7d4d06c5bfcc0e2abb |
|
MD5 | 065e3e1650e3fd0e0d2989997030d495 |
|
BLAKE2b-256 | a334890d33f6fd55c2b3e604a100c51d54c878110636b2bafeac1c8c0a49229a |