MULTITENANT ARCHITECTURES IN PYTHON
This is the repository for the Multitenant implementation shown in my talk at PyCon Colombia 2018
For this project we are using django-tenant-schemas, please check the documentation for a full scope of its features.
This is a dummy project to show you how to implement a multitenant architecture
single database, multiple schemas model.
The project is a tiny notes creators in which you can create tenants and inside each tenant you can create some notes and check how they are isolated per schema.
I've tried to document very well the code and also it has a clean Django implementation, but, if for some reason you are having troubles with some section of the code or I didn't make myself clear or even you want to discuss about multitenant in general, don't hesitate to contact me and I'll be glad to help you!
- Email: email@example.com
- Twitter: @MiltonLn
- Clone the project:
git clone https://github.com/MiltonLn/pycon-multitenant.git
- Create a virtualenv for the project, i.e:
virtualenv -p ``which python3.6`` venv
- Activate your virtualenv and install requirements:
pip install -r requirements.txt
- Create a postgres role and database for the project, the current values in the settings are user, password, db: pycon_multitenant
- Migrate the database, REMEMBER, in
django-tenant-schemaswe should always use
python manage.py migrate_schemas
django-tenant-schemaswe always need to create a db record for the public tenant, fortunately, I've created a handy django command to do this, so you can run:
python manage.py create_public_tenant, please don't hesitate to check its implementation in
- You are ready to go! just run:
python manage.py runserverto test the project and create some tenants