I'm making a project in django. The aplication have to show diferent images and languages depending on the subdomain. For example: www.mysite.com will be the default page in english, but if the subdomain is mx.mysite.com the language must be spanish.
Whith django-hosts I can make that each subdomain redirect to a diferent django-app and I works well. The problem is that I want to make only one app to all diferent subdomains, only changing the language.
I think that is possible get the subdomain in a view and render the template with the language depending on the subdomain. But I don't know how to do it, please help.
THIS IS MY DJANGO HOSTS.PY where the host 'www' and 'mx' redirect to the same app 'mysite' but must be in diferent languages.
from django.conf import settings
from django_hosts import patterns, host
host_patterns = patterns('',
host(r'www', 'mysite.urls', name='www'),
host(r'help', 'help.urls', name='help'),
host(r'mx', 'mysite.urls', name='mx'),
)