Django have a lot of methods to detect locale settings. For example url, cookie, session, query arg, browser language settings and other. But in project i required to publish locale site versions on different domains, i tried google for this but have not luck with it.

I developed middleware for django to allow it support different locales on required domains.

Take a look into languages configuration

And the middleware code is here

And you of course needed load this middleware default way for django. I load this middleware immediately after django.contrib.sessions.middleware.SessionMiddleware.

Enjoy!

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>