Forums

Two domains, one app, different homepages

Hi there,

I've read a few posts which say to add a second domain to the same django app you need to add a second PA app and then match the WSGI files ... all makes sense with that.

I want domain2 to reach a different homepage than domain1, will I have access to which domain is being used inside my views? Is the string "domain1.com" or "domain2.com" available in the request object or similar so I can redirect all domain2 requests to a seperate django app?

Thank you

Just to make sure I understand what you're trying to do -- you want to use the same Django code for two different domains, but display a different site for each domain. Is that right?

If so, then yes, and Django actually has built-in support that should make it easy. Check out the Django "sites" framework.

Perfect thanks giles