Skip to main content

django-nofloc nlshield

django-nofloc is a simple Django app that provides a middleware to let Google Chrome know that your website should not be included in the Google FLoC program. Essentially you’re opting out of this privacy invading program that is default for all Chrome users.

Version: 0.1.0

Project Links: Mailing List - Contributing

Author: Peter Sanchez (https://netlandish.com)

Because this is a simple middleware we have no issue tracker for it. If there are any issues please send an email to the mailing list.

Python / Django Support

  • Python 3.6+ for Django versions 2.2+

Installation

PIP:

pip install django-nofloc

Basic Manual Install:

$ python setup.py build
$ sudo python setup.py install

Then just add the nofloc.middleware.NoFLoCMiddleware to your MIDDLEWARE setting. The placement order shouldn’t matter.

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'nofloc.middleware.NoFLoCMiddleware',
]

This will set the Permissions-Policy header to a value of interest-cohort=() for every request served by Django.

If you need to alter this header within a view or some other case, this app may not be a good tool for you to use in it’s current state. It’s set specifically to disable FLoC. Review your use case before installing this app. You can also submit a patch to make this more configurable if you’d like :)

Why?

Because we’re tired of big tech spying on us. For more info see:

https://plausible.io/blog/google-floc

Contributing

We accept patches submitted via hg email which is the patchbomb extension included with Mercurial.

The mailing list where you submit your patches is ~netlandish/public-inbox@lists.code.netlandish.com. You can also view the archives on the web here:

https://lists.code.netlandish.com/~netlandish/public-inbox

To quickly setup your clone of django-nofloc to submit to the mailing list just edit your .hg/hgrc file and add the following:

[email]
to = ~netlandish/public-inbox@lists.code.netlandish.com

[patchbomb]
flagtemplate = "django-nofloc"

[diff]
git = 1

We have more information on the topic here:

Metadata

Release files for django-nofloc 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-nofloc 0.2
File Size Uploaded
django-nofloc-0.2.tar.gz 5.3 kB Details

Release files / django-nofloc-0.2.tar.gz

Download URL django-nofloc-0.2.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
499e4abfa4c2cb72c19cf86b11e41d4ea7d2ebb10b9ecf3570472cca1a0196af
BLAKE2b-256 checksum
How to use checksums
8f2e0a55f5679c479d8809bdcefba597dc3c46cd174517fd3be6079070422837
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.10

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page