Reputation: 4557
I have a Django project and I wanted to map a URL to handle subdomains. If there is a subdomain then it should call a function with the subdomain as a parameter. Is this possible? If not then what would be the best way to tell what the subdomain of a request is?
Thanks
Upvotes: 2
Views: 1247
Reputation: 15526
This is definitely possible - you'll need to tweak your configuration files so that subdomain requests are sent to that URL instead of the root of your app, and then you should be good to go (use request.get_host()
to retrieve the domain you're being called at).
Upvotes: 4