Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A django app which helps to implement multitenancy easily

Project Description
## 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
Release History

Release History

This version
History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
djangomultitenant-0.0.2.tar.gz (2.3 kB) Copy SHA256 Checksum SHA256 Source Apr 19, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting