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" ,
# ...
]
Note
The middleware should be added before UpdateCacheMiddleware , as it uses the value of
HTTP_COOKIES which needs to be modified.
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" ,
]
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages .
Source Distribution
Built Distribution
File details
Details for the file django-cookiefilter-1.0.tar.gz
.
File metadata
Download URL:
django-cookiefilter-1.0.tar.gz
Upload date:
Jun 13, 2023
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
Copy
MD5
52615dd53a624cac0dd287cbc6d36388
Copy
BLAKE2b-256
86ea0fd80f0528714480c7f972dc5b80b20ca63878df4f76a68a7fdbf7c66a4b
Copy
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
Copy
MD5
7a6a199275850e03cb0a33242bde8655
Copy
BLAKE2b-256
90658714b39fba9e66b0c73857a0f9e4c4c4e379f0f8343b0189025686cd4ea1
Copy
See more details on using hashes here.