python - Using subdomains in django -
please tell me whether possible (if so, how) use pages each user subdomains. example, have url of form: http://hostname.com/user/1 need http://username.hostname.com/ you have number of options depending on how in-depth want go. one option handle routing @ web server level. capture subdomain part of url , rewrite different location within server. for example http://username1.local.host/signin captured webserver , internally routed resource such /username1/signin . end user subdomains code handle url parts none wiser has happened. your urls.py handle normal request. url_pattern = [ ... url(r'(?p<subdomain>[a-z]+)/sigin/$', 'view'), ] for nginx need "subdomain subdirectory re-writing". i use option have stated in question. whilst method little more tricky setup (keep @ until works). lot easier maintain , work in long run. use option have stated in question. the other option handle subdomains @ django level using package su...