user79762
user79762

Reputation: 45

quick question: how to set *.domainname.com url in django

I know there are lots of example for how to set http://domainname.com/username url. But how to set http://username.domainname.com url in django?

Thinking a way to have a unique url for each user as http://username.domain.com like http://garry.posterous.com/

Thanks

Upvotes: 3

Views: 270

Answers (2)

panchicore
panchicore

Reputation: 11922

see Using Subdomains with Django: http://www.rossp.org/blog/2007/apr/28/using-subdomains-django/

Upvotes: 0

Martin v. Löwis
Martin v. Löwis

Reputation: 127447

As the first step, you need to arrange your DNS server to serve the wildcard domain; this is completely outside Django.

When you managed to do that (i.e. dig garry.posterous.com succeeds), then simply check for the HTTP_HOST request variable in the django view routines.

Upvotes: 3

Related Questions