How to Host a Django Website for FREE - Beginner's Step by Step Tutorial
Beginner
2021-04-12
A Beginner's step-by-step guide showing you how to deploy or host your Django websites ...
Date Published: 2021-07-05
Peng Akebuon
⭐ 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