Django Ultratenant
Pitch (Portuguese)
- Part 1: https://www.loom.com/share/a90948958c184a0fb64868bbb0230a28
- Part 2: https://www.loom.com/share/52fd66b6f5a047f88a9fed56c1cf70d1
What is
-
Django multi-tenant library that implements diferent approaches
-
Simple API with minimal setup
-
Transparent for the application
-
Supported isolations approaches:
- multi-db
- multi-schema
- tenant-id
-
Supported URL approaches: subdomain and path
- tenant.url.com
- url.com/tenant/admin/
-
Support multiple databases
-
Good documentation
Contributing
Rules to contribute
Clone the code
git clone https://github.com/HBN3tw0rk/django-ultratenant
cd django-ultratenant
git checkout main
Or
git clone git@github.com:HBN3tw0rk/django-ultratenant.git
cd django-ultratenant
git checkout main
Setup the project
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install ".[test]"
pre-commit install
pre-commit autoupdate
pytest
Create a new branch
git fetch origin
git checkout -b task/branch-name-you-work-issue
Create a pull request to the branch main
Ultimate Django app for multi-tenant.
- Documentation: https://django-ultratenant.readthedocs.io.
Installation
pip install django-ultratenant
How to Use
- TODO
Alternatives
- https://github.com/django-tenants/django-tenants/ - only Postgres with multi-schema
- https://github.com/citusdata/django-multitenant - only Postgres (with Citus extension)
Base projects
MVP
-
setup and pip
-
SQLite3 support
-
multi-db
-
tenant on URL path
-
documetation about how customize manage.py
API
# settings.py
from ultratenant.multidb import Databases
...
MIDDLEWARE = [
...
'ultratenant.path.Middleware',
]
...
DATABASES = Databases(config('DATABASE_URL', cast=dburl))
DATABASE_ROUTERS = ['ultratenant.multidb.Router']
(maybe it won't be necessary)
# urls.py
...
from ultimate_tenants.urls import tenants_path
urlpatterns = tenants_path([
path('admin/', admin.site.urls),
path('', index, name='index'),
])
# url.com/tenant/admin
Roadmap
-
other databases supported by Django: PostgreSQL, MariaDB, MySQL, Oracle
-
multi-schema
-
tenant-id
-
custom [manage.py]{.title-ref} to access different tenants
-
cookiecutter to create a new project
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
[0.0.1] - 2022-07-31
Added
- First release on PyPI.
Metadata
Release files for django-ultratenant 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-ultratenant-0.0.3.tar.gz | 4.8 kB | Without provenance | Details for django-ultratenant-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_ultratenant-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for django_ultratenant-0.0.3-py3-none-any.whl |
Total release size: 11.0 kB
Release files / django-ultratenant-0.0.3.tar.gz
| Download URL | django-ultratenant-0.0.3.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
817425f41b1ba8882fd000f8b683b970a6312f33a3df3b023ea0f8a56a976731
|
|
BLAKE2b-256 checksum How to use checksums |
23959b370d59ef4b26c4c17aa6b8302b70f65d060cf199d3d73f38ca1a0522a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / django_ultratenant-0.0.3-py3-none-any.whl
| Download URL | django_ultratenant-0.0.3-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aee9e60c9b7fcc62864735652d524643a363e3a2107f181107d33454dc6bb053
|
|
BLAKE2b-256 checksum How to use checksums |
dd4608a70bcc3b6d724c0062d35ca3379b422bae2c9bbda5ac052646a2030ec7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Security for django-ultratenant 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.