Django Backend and API for Evercookie Library
HTML Python
Switch branches/tags
Nothing to show
Clone or download
Latest commit 5943102 Nov 14, 2017

Django Evercookie

Django Evercookie is an implementation of [Evercookie] ( with Django backend services. Evecrookie core component was rebuilt to use of Django's batteries, so all configurations and hook-ups are done in plain Python and Django's templatetags.

Note: Django 1.5 or later required.


The project hasn't been maintained for quite some time. Afaik later Django versions have some API changes that require the backend to be modified. If you want to contribute to the project and keep it up to date, please send pull requests.

Browser Storage Mechanisms Supported in Django Evercookie

Client browsers must support as many of the following storage mechanisms as possible in order for Evercookie to be effective.

External Dependencies

Is used to turn off Vary HTTP headers for some views because Django adds this headers automatically if Auth and Session middlewares are used.

To generate PNG cookies.


  1. Install Python Egg
pip install git+
  1. Add Django Evercookie to INSTALLED_APPS
INSTALLED_APPS += ('django_evercookie',)
  1. Add RemoveUnneededVaryHeadersMiddleware at the top of MIDDLEWARE_CLASSES in
  1. Add routing in
urlpatterns += patterns('', ('', include('django_evercookie.urls')),)

Basic Configuration

Sometimes you need to configure things your way. Some snippets of configuring Django Evercookie.

from django_evercookie.config import settings
#Changing cookie names for Etag storage
settings.etag_cookie_name = 'etagstorage'
#Enabling CSS History Knocking
settings.history = 'true'
#Setting Django's STATIC_URL manually
settings.static_url = '/cdn/'

Using Templatetags

Add this code to load evercookie in template and set a value.

{% load staticfiles %}
<script src="{% static 'django_evercookie/swfobject-2.2.min.js' %}"></script>
<script src="{% url 'django_evercookie.views.evercookie_core' %}"></script>
{% load evercookie_js_api %}
{% set_evercookie ec_obj='evercookie' name='dummy' value='some_value' %}

This will load evercookie core library and render set method.

var evercookie=new evercookie();
evercookie.set("dummy", "some_value");

The get method is as simple as adding

{% rediscover_evercookie ec_obj='evercookie' name='dummy' %}

to discover what was set in previous snippet.


Evercookie was developed by Samy Kamkar, with contributions from others