title: How do I have users per domain name in Django?
body: <p>I'm building an application using Django in which each customer will have their own domain name (subdomain in our domain, such as customer.example.com or their own domain, such as customer.com). Ignoring the problem of web server configuration, SSL (that'll be fun, thank god for Let's Encrypt), etc, in Django, how can I have users per domain?</p>
  
  <p>The customers would be one type of user and the customer's users would be a different type. The same username should be useable in each of the served domains. Is there anything prebuilt that can help? If not, how do I modify the way auth happens in Django to limit it to the current domain.</p>
  
  <p>My problem is not how to serve each of the domains/subdomains, but how to do authentication (registration, password reset, and all that), which means thisis  not a duplicate of <a href="https://stackoverflow.com/questions/31178022/using-subdomains-in-django">Using subdomains in django</a></p>
  
  <p>I have looked into <a href="https://github.com/tomturner/django-tenants" rel="nofollow noreferrer">https://github.com/tomturner/django-tenants</a> and <a href="https://github.com/bernardopires/django-tenant-schemas" rel="nofollow noreferrer">https://github.com/bernardopires/django-tenant-schemas</a> and for my use case, using PostgreSQL schemas to separate the data is not appropriate.</p>