• django>=1.4
  • lxml
  • html5lib


To get started using django-html5-appcache install it with pip:

$ pip install django-html5-appcache

If you want to use the development version install from github:

$ pip install git+

Requirements will be automatically installed.

Run migrate command to sync your database:

$ python migrate html5_appcache


Migrations have been added in 0.3.0. Don’t skip this if you are upgrading from 0.2.

Basic configuration

  • Add html5_appcache to INSTALLED_APPS.

  • Include in your URLCONF:

    urlpatterns += patterns('',
        url('^', include('html5_appcache.urls')),


on Django 1.4+ (or django CMS 2.4+) you may need to use i18npatterns instead of patterns above, depending on you project layout.

  • Enable appcache discovery by adding the lines below in

    import html5_appcache
  • Add the middleware just below django.middleware.cache.UpdateCacheMiddleware, if used, or at the topmost position:

  • Insert appcache_link template tag in your templates:

    {% load appcache_tags  %}
    <html {% appcache_link %} >
  • Enable the cache for your project. Refer to Django CACHES configuration.

django CMS integration

See django CMS installation.