Re: Automatic subdomain for each user

2021-12-30 Thread Joel Tanko
Check out the django-hosts package, the docs are pretty explanatory and easy to use. You'd also want to add '.yourdomain' to the allowed_hosts list and it doesn't work with '127.0.0.1' as its harder for if to figure out the sub-domain, if you want to use it on your development server use

Re: Automatic subdomain for each user

2021-12-30 Thread Nick Farrell
Once you have the TLS certificates and routing working, can't you make a tiny piece of middleware which takes the hostname (provided via nginx/apache in a request header) and add an attribute on the request which corresponds to your virtual site? e.g. (dodgy untested code follows): def

Re: Automatic subdomain for each user

2021-12-30 Thread Sherif Adigun
Thank you for your detailed response. Following your response point by point with few additional googling, it works as expected. On cpanel: I created a subdomain called * Then I chose document root as the main Django root. (This is needed so that letsencrypt can automatically create a

Re: Automatic subdomain for each user

2021-12-30 Thread Sherif Adigun
Thank you very much for you guidance. I have been able to make it work using Django-hosts on my local. Still trying to fix it out to work on my shared hosting if possible On Thu, Dec 30, 2021, 10:29 AM Sherif Adigun wrote: > Thank you @Tim. Django subdomains looks promising but it's outdated.

Re: Automatic subdomain for each user

2021-12-30 Thread Sherif Adigun
Thank you @Tim. Django subdomains looks promising but it's outdated. It uses codes and imports of django< v2 I have checked django-hosts but it looks as if it can be used for only predefined list of subdomains. Please help clarify this doubt. Thank you for your time On Thursday, December

Re: Automatic subdomain for each user

2021-12-29 Thread Tim Chase
On 2021-12-29 15:02, Sherif Adigun wrote: > I am faced with a requirement where each user is required to use > the application under his own subdomain. Whenever a user registers, > he gets username.domain.com and he can add staff, manage reports, > etc under his subdomain. > > What is the best

Automatic subdomain for each user

2021-12-29 Thread Sherif Adigun
I am faced with a requirement where each user is required to use the application under his own subdomain. Whenever a user registers, he gets username.domain.com and he can add staff, manage reports, etc under his subdomain. What is the best approach to you can suggest please? -- You