[Answered ]-One django project – render different content depending on domain

2👍

You can edit you hosts file (/etc/hosts in unix, mac or C:/windows/system32/drivers/etc/hosts at windows) and add some domains, like this:

127.0.0.1    domain-usa.com
127.0.0.1    domain-hun.com

after this, run dev server as public (python manage.py runserver 0.0.0.0:8000)
and go to url http://domain-usa.com:8000/

get_current_site look at SITE_ID in your settings, but you need to get request.META['HTTP_HOST'] variable, and get domain from it.

Leave a comment