A Python Django prerender middleware for Localize JS

django, seo, prerender
pip install django_localizejs_seo==0.2


Localize.js SEO for Django

Python Django middleware that provides full SEO support for Django apps using Localize.js. This middleware detects requests from search engine bots and crawlers, and replies with prerendered HTML via our hosted prerendering API.

Questions? We're happy to help. Email us!.


Install via Pip:

pip install django_localizejs_seo

you can also install by downloading the repo and run python install

To add the Localize.js SEO middleware to your Django project, first add the app and middleware in your file:

INSTALLED_APPS += ('django_localizejs_seo',)


Then under, add the following lines to enable Localize SEO and customize prerender url


How it works

When a request is made to your server using this middleware, here's what happens:

  1. Middleware checks if request is a GET request. If not, middleware returns None is called and the middleware is bypassed.
  2. Middleware checks if request is made from a search engine bot or crawler (like Googlebot). If not, returns None is called and the middleware is bypassed.
  3. When a GET request is made to your website by a search engine bot or crawler, the middleware makes a request to our prerendering API for the prerendered HTML of the page that was requested.
  4. The prerendered HTML is received from the API and delivered to the search engine crawler for indexing.

This is a hosted prerendering service, meaning that the prerendering of your page and caching is offloaded to our servers.


There are two built in layers of caching. We use Redis on our server to cache your HTML, and the reply is sent through the Amazon Cloudfront CDN to ensure extremely low latency response no matter where your server is (typically less than 20-50ms for a cached request).


Forks and pull requests welcome!


  • Add request timeout
  • Add tests


Localize.js. For support, email