Multi-tenant design with all auth login

Hello,

I’m building my first django app and it will be multi-tenant, using the schema per customer layout with django-tenants.

I have all-auth on my app where users can sign up with a work email. Once that’s done, I want to take the email domain and map it to a domain in django tenants. I’d like this to happen once the user has completed email verification.

Can anyone who’s done something similar offer advise or good resources to read on achieving this?

Thankyou

Is there a chance this is unnecessary here? Could I just put users into groups and restrict the data they can see based on their groups?

It’s possible.

It’s really an issue of how much is the same and how much is different between the customer groups, and how much of this is under your control and how much control needs to be given to those groups.

Ok, that makes sense. This app will be for business customers so their data will need to be seperate.

To respond to your comment:

It’s really an issue of how much is the same and how much is different between the customer groups, and how much of this is under your control and how much control needs to be given to those groups.

Customers will be from the same industry and their data will have the same models, but each customer will have their own schema under a subdomain.

Customers will be uploading their own data and will be able to manage it. They’ll need to be able to create, read, update and delete the data. I’ll also be using the data in the same way too for other features.

Here’s some links i’ve found useful whilst reading around this topic:

http://django-pgschemas.readthedocshttps//django-tenant-users.readthedocs.io/en/latest/.io/en/stable/overview/

## Tenant Onboarding and Automated Provisioning

Self-service tenant provisioning — from signup to fully functional account in under 30 seconds — is essential for product-led growth SaaS. Here is the complete onboarding pipeline.

Signup flow architecture:

Registration (public schema): User submits email, password, company name. Create User and Client records in the public/shared schema. Generate a unique schema_name from company slug (sanitised, max 63 characters for PostgreSQL identifier limit).

Schema provisioning: Call tenant.create_schema(check_if_exists=True) from django-tenants. This runs CREATE SCHEMA and applies all tenant migrations. For a typical SaaS with 30-40 models, this takes 2-5 seconds.

Seed data: Populate default categories, settings, templates, and sample data. Use a post_schema_sync signal handler or a provision_tenant() Celery task.

DNS/subdomain: Create Domain record mapping acme.yourapp.com to the new tenant. If using wildcard DNS (*.yourapp.com pointing to your server), no DNS propagation wait is needed.

Welcome email: Celery task sends onboarding email with login link, getting-started guide, and calendar link for optional demo call.

However, think that the question I still need to answer is weather this is really needed for my app. I don’t expect to have thousands of users at this stage and probably row-level tenancy is the best option for my app, with the possibility of moving into seperate schemas further down the line.

Would be interested to hear any input on this.