Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nhymxu/django-floc-disable
Django middleware to disable Google's Federated Learning of Cohorts (FLoC) tracking
https://github.com/nhymxu/django-floc-disable
django django-application floc middleware
Last synced: 14 days ago
JSON representation
Django middleware to disable Google's Federated Learning of Cohorts (FLoC) tracking
- Host: GitHub
- URL: https://github.com/nhymxu/django-floc-disable
- Owner: nhymxu
- License: mit
- Created: 2021-05-12T03:52:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-25T14:51:59.000Z (26 days ago)
- Last Synced: 2024-12-25T15:07:15.091Z (26 days ago)
- Topics: django, django-application, floc, middleware
- Language: Python
- Homepage: https://pypi.org/project/django-floc-disable/
- Size: 12.7 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# django-floc-disable
[![unit test](https://github.com/nhymxu/django-floc-disable/actions/workflows/test-python.yml/badge.svg?branch=main)](https://github.com/nhymxu/django-floc-disable/actions/workflows/test-python.yml)
Django middleware to disable Google's Federated Learning of Cohorts (`FLoC`) tracking
New version is Topics API
## Python / Django Support
- Python 3.8+
- Django versions 3+## Usage
Install django-floc-disable:
```shell
pip install django-floc-disable
```Add it to your `MIDDLEWARE` tuple in `settings.py`:
```python
MIDDLEWARE = (
# ...
'django_floc_disable.middleware.FLoCDisableMiddleware',
# ...
)
```This will set the `Permissions-Policy` header to a value of `browsing-topics=()` for every request served by Django.
Reference:
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy/browsing-topics
- https://developers.google.com/privacy-sandbox/private-advertising/topics/web/controls#opt_out_as_a_developer## Support
* Issues:
* Here you can [donate](https://dungnt.net/donate.html) for this project.## License
The MIT License (MIT). Please see [License File](LICENSE.txt) for more information.