Skip to main content

Opt out of the privacy invading Google FLoC program.

Project description

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:

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-nofloc-0.2.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file django-nofloc-0.2.tar.gz.

File metadata

  • Download URL: django-nofloc-0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for django-nofloc-0.2.tar.gz
Algorithm Hash digest
SHA256 499e4abfa4c2cb72c19cf86b11e41d4ea7d2ebb10b9ecf3570472cca1a0196af
MD5 b6fd17e46bf110f8caebcbd753af04d1
BLAKE2b-256 8f2e0a55f5679c479d8809bdcefba597dc3c46cd174517fd3be6079070422837

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page