Skip to main content
## Django Multitenant ##

This app can be used to implement multitenant architecture within your django project very easily.

Inorder to install the app


```
pip install djangomultitenant
```


Modify the project settings file as shown below


```
DATABASES = {
'default': {

},

# DB for tenant 1
'akhil': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'akhil.sqlite3'),
},

# DB for tenant 2
'nikhil': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'nikhil.sqlite3'),
}
}

INSTALLED_APPS = [
'djangomultitenant',
]

DATABASE_ROUTERS = [
'djangomultitenant.Router',
]

MIDDLEWARE = [
'djangomultitenant.Middleware', # this has to be the first one
]
```

Use the TENANT-CODE header in all your requests to the django project. You can use [requestly](https://chrome.google.com/webstore/detail/requestly/mdnleldcmiljblolnjhpnblkcekpdkpa?hl=en) to send the headers while accessing project. In the production environment, these headers can be configured in the webservers.

```
TENANT-CODE: akhil
```

Tada !!! You are all equipped with multitenancy !!!

Note: migrations and management commands are not handled by this app. so please dont forget to use --database

Metadata

Release files for djangomultitenant 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djangomultitenant 0.0.2
File Size Uploaded
djangomultitenant-0.0.2.tar.gz 2.3 kB Details

Release files / djangomultitenant-0.0.2.tar.gz

Download URL djangomultitenant-0.0.2.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
efaf409d7a7dd040d88b55adf08217a156c4437dcb7071b2e37143a147bee727
BLAKE2b-256 checksum
How to use checksums
87d857be0aba0c7ab64c00b4edf55a71df8906b9e8504bef19af18305228e3b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page