How do I set urlpatterns based on domain name or TLD, in Django?
How do I set urlpatterns based on domain name or TLD, in Django? For some links, Amazon shows url in native language based on its website tld. http://www.amazon.de/bücher-buch-literatur/ ( de : books => bücher ) http://www.amazon.fr/Nouveautés-paraître-Livres/ ( fr : books => Livres ) http://www.amazon.co.jp/和書-ユーズドブッ-英語学習/ ( jp : books => 和書 ) ( the links are incomplete and just show as samples. ) Is it possible to get host name in urls.py? (request object is not available in urls.py) or maybe in process_request of middleware and use it in urls.py(how???) Any alternate suggestions how to