Django app to opt your website out of the Google FLoC program.
Small version bump for header reference change
Addressing issues where various response types don't have a headers attr


browse log



#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.2.0

Project Links: Mailing List - Contributing

Author: Peter Sanchez (

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+



pip install django-nofloc

Basic Manual Install:

$ python build
$ sudo python install

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


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 :)


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


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/ You can also view the archives on the web here:

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

to = ~netlandish/

flagtemplate = "django-nofloc"

git = 1

We have more information on the topic here:

All documentation, libraries, and sample code are Copyright 2021 Netlandish Inc. <>. The library and sample code are made available to you under the terms of the BSD license which is contained in the included file, LICENSE.