Reputation: 11038
how can i manage in django multiple domains? Our website will be configured like this
jobs.site.com
cars.site.com
homes.site.com
jobs.site.co.uk
cars.site.co.uk
....
and so on. basically, we will have three third level domains (jobs,cars,homes) and some country specific domains.
i'm actually working locally with urls like "localhost/uk/jobs/" but when we're going live we should use jobs.site.co.uk instead...
i really have no clue, nor i know what i should search on google, can somebody please provide me a brief but full "howto" to configure my settings (or full django app) to do exactly what i need?
thanks in advance!
Upvotes: 4
Views: 5157
Reputation: 750
If they share the same code or database, you will have to retrieve the subdomain name creating your own subdomain middleware.
Have a look to this http://thingsilearned.com/2009/01/05/using-subdomains-in-django/
Upvotes: 5
Reputation: 13116
It depends on how you run your Django projects, but to me it looks like xyz.site.com
could be different projects. If they all share the same code, see the second paragraph below.
Take a look at the Django "sites" framework if you need to distinguish between different hosts within a single Django project (like jobs.site.co.uk
and jobs.site.com
).
Upvotes: 1