⭐ In this series, we will build a Software as a Service ( Saas ). We first go through the definition of terms and talk about the relation between a Saas software and Multitenancy. Finally, we talk about the different approaches to solving multitenancy.
# Middleware and Database Setup
MIDDLEWARE = [
# add this at the top
# django tenant middleware
'django_tenants.middleware.main.TenantMainMiddleware',
#........
]
# Setup Postgres database in settings.py
DATABASES = {
'default': {
# Tenant Engine
'ENGINE': 'django_tenants.postgresql_backend',
# set database name
'NAME': 'saasy',
# set your user details
'USER': 'admin',
'PASSWORD': 'password',
'HOST': 'localhost',
'POST': '5432'
}
}
# DATABASE ROUTER
DATABASE_ROUTERS = (
'django_tenants.routers.TenantSyncRouter',
)
Let's Connect
🔗 LinkedIn
🔗 Twitter
🔗 Join Our Discord Server