Building Multi Tenant Applications with Django by Shabda Raaj

Building Multi Tenant Applications with Django by Shabda Raaj

Author:Shabda Raaj [Raaj, Shabda]
Language: eng
Format: epub
Publisher: Agiliq Info Solutions India Pvt Ltd
Published: 2018-07-28T23:00:00+00:00


Created a mapping of tenants to schemas

Set the tenant specific schema in middleware

In this chapter, we will

Use request header to find the tenant

Create a mapping of tenants to databases

Set the tenant specific database in middleware.

Let’s get rolling.

Multiple database support in Django

Django has descent support for a multi DB apps. You can specify multiple databases in your settings like this.

DATABASES = { "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "default.db"}, "thor": {"ENGINE": "django.db.backends.sqlite3", "NAME": "thor.db"}, "potter": {"ENGINE": "django.db.backends.sqlite3", "NAME": "potter.db"}, }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.