[Django]-Language by domain in Django

3👍

You may want to have a look at Transurlvania as it allows you to map a domain to a language:

MULTILANG_LANGUAGE_DOMAINS = {
    'en': ('www.example-en.com', 'English Site'),
    'fr': ('www.example-fr.com', 'French Site')
}

5👍

Why don’t you write your onw tiny middleware class that you add after the LocaleMiddleware, that simply adds the language, if no language has been identified yet based on the rules that you have explained here in that thread.

0👍

You could use a separate site for each domain, and use a view mixin or a middleware to check the site id and react appropriately.

Leave a comment