🔑 Project Overview Building scalable, secure multi-tenant applications has never been easier! This cookie cutter project provides a powerful solution to managing multiple tenants using Django Admin, while leveraging Jazzmin for a modern and intuitive interface.
🛠️ Key Features
- Sub-domain based tenant separation so each client gets their own secure, isolated space, ensuring their data stays private and accessible only to them.
- Database-agnostic architecture which Works seamlessly with any database.
- Effortless CRUD operations
- Pre-styled with Jazzmin for a sleek, modern UI without the hassle of designing from scratch.
⚙️ Why Use This?
Juggling tenant isolation and management doesn't have to be a headache. This cookie cutter project simplifies the complexities of multi-tenancy, giving you the ability to focus on growth and innovation without sacrificing security or performance.
🚀 Get Started Fast
- Fork the repo
- Clone your fork
- Create a branch for your changes
💡 Ideal For
- SaaS applications requiring secure client data isolation
- Teams needing a quick, efficient, and scalable solution for multi-tenant platforms
Before we get started, it is important to note that this app is a Multi-Tenant app using ID's to seperate the tenants. The app uses subdomains i.e. yourcompany.DjangoMultiTenant.co.za to identify different tenants.
- Fork the repo.
cd to DjangoMultiTenantPublic
- Build virtual environment for the project
python manage.py -m venv venv
this will create a virtual environment, now we need to activate it
On Windows
.\venv\bin\activate
On Linux
source venv/bin/Activate
Remember to create a new branch on your repo! Do not use master/main as this will cause issues later on for subsequent pull requests!
After complete forking the repo, creating a venv and activating it, install the requirements.txt
pip install -r requirements.txt
For local development, it is recommended to setup a psuedo domain (as this is a multi tenant app). Open your hosts file and add an entry that looks something like this: (There are a lot or resources online to add entries to your host file for your respective OS ). You can use any domain name you like.
127.0.0.1 acme.DjangoMultiTenant.co.za
As this is this a cookie cutter project, we are using
Create a .env file in the root directory of DjangoMultiTenant, and set the following Variables
# Dev
SECRET_KEY=< Your Secret Key Goes Here>
# Environment
DEVELOPMENT=True/False
The first step is to run migrations
python manage.py migrate
Once migrations are successfull, there is a custom command under:
└── root
└── system_management
└── managment
└── commands
└── makesuperuser.py
You can double check and change the super user details in here.
Run this command using:
python manage.py makesuperuser
Then we start the app using the domain you specified
python manage.py runserver acme.djangomultitenant.co.za:8000
Follow this guide to deloy the app on your own server
Interested in contributing? Check out our CONTRIBUTING.md to find resources around contributing.