Skip to main content

Django Cookie Filter

Project description

Django middleware which removes all unwanted cookies - useful for improving cache hit ratios when analytics cookies interfere with caching.

Installation

Using pip:

$ pip install django-cookiefilter

Edit your Django project’s settings module, and add the middleware to the start of MIDDLEWARE:

MIDDLEWARE = [
    "cookiefilter.middleware.CookieFilterMiddleware",
    # ...
]

Configuration

Out of the box the standard Django cookie names will work without any other configuration. However if your project uses different or additional cookie names, edit COOKIEFILTER_ALLOWED in your project’s settings module:

COOKIEFILTER_ALLOWED = [
    "analytics",
    "csrftoken",
    "django_language",
    "messages",
    "sessionid",
]

Project details


Download files

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

Source Distribution

django-cookiefilter-1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

django_cookiefilter-1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file django-cookiefilter-1.0.tar.gz.

File metadata

  • Download URL: django-cookiefilter-1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for django-cookiefilter-1.0.tar.gz
Algorithm Hash digest
SHA256 ebdf26e698270eaa6f32e400a002a5ed412bd178557e479132c62a8d19f196a3
MD5 52615dd53a624cac0dd287cbc6d36388
BLAKE2b-256 86ea0fd80f0528714480c7f972dc5b80b20ca63878df4f76a68a7fdbf7c66a4b

See more details on using hashes here.

File details

Details for the file django_cookiefilter-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_cookiefilter-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66a328b009c3037b29f44c0f9f624284d4d5581fccb55e1e8351ca34b75776f1
MD5 7a6a199275850e03cb0a33242bde8655
BLAKE2b-256 90658714b39fba9e66b0c73857a0f9e4c4c4e379f0f8343b0189025686cd4ea1

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