I am developing a web app using django for server-side. It has clients in android, ios and frontend. I was thinking of using subdomains for differentiating the urls of these clients. The differentiation is due to the fact that responses to urls are different for different clients. I was hoping of being able to do using subdomains like android.example.com, ios.example.com...etc. My subdomains are fixed.
Can you help regarding what approach I should take to achieve this. Some options I have read are
- Hosting two different project with same database.(Looks quite good for me, but may not be the optimum)
- Hosting on same instance using sites framework.(Not sure as to how good this option is)
- Hosting using virtual-host(Really Not able to understand how to achieve this).
- Using a Sub-domain Middleware, as mentioned in many of answers and also in some Django Snippets.
Please help me with the best option and if possible with links to some tutorials as to how to achieve it. Thanks.