My application is going to be hosted in multiple domains, I need a domain name in django view function...How to achieve this? I am using django 1.3.3.
I want something like this
www.syz.com 127.0.0.1:8000
Have a look at request.get_host()
Doc: https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.get_host
Or in your template (if you use a requestContext) {{request.get_host}}
as @jayanth-koushik mentionned it, you can find more here: How can I get the domain name of my site within a Django template?