Django: setting up multiple domains for a website?

how can i manage in multiple django domains? Our site will be configured as follows

jobs.site.com cars.site.com homes.site.com jobs.site.co.uk cars.site.co.uk .... 

etc. Basically, we will have three third-level domains (jobs, cars, houses) and some countries related to a specific country.

I actually work locally with URLs like "localhost / uk / jobs /", but when we are going to live, we should use jobs.site.co.uk instead ...

I really don't have a clue, and I don’t know what I should search in google, can someone please provide me with a short but complete "howto" to configure my settings (or the full django application) to do exactly that what I need?

Thanks in advance!

+4
source share
2 answers

It depends on how you run Django projects, but it seems to me that xyz.site.com can be different projects. If they all have the same code, see the second paragraph below.

Take a look at the structure of Django sites if you need to distinguish between different hosts within the same Django project (e.g. jobs.site.co.uk and jobs.site.com ).

+1
source

If they have the same code or database, you will need to get the subdomain name by creating your own middleware in the middle domain.

Take a look at this http://thingsilearned.com/2009/01/05/using-subdomains-in-django/

+5
source

All Articles