- Inside the project folder create a hidden environment file called
.env
with these contents - Inside the project folder run in the console
docker-compose up
- Check if the
api-server
&db-server
are up:docker ps
.
# generic
PYTHONUNBUFFERED=true
# for postgres
POSTGRES_DB=some_db_name
POSTGRES_USER=some_db_user
POSTGRES_PASSWORD=some_hard_password
- To access the DB:
docker-compose exec api-server python3 manage.py dbshell
- To run all tests:
docker-compose exec api-server python3 manage.py test
- Run migration:
docker-compose exec api-server python3 manage.py migrate
- Create a superuser:
docker-compose exec api-server python3 manage.py createsuperuser
- Set your tenant name to the get_tenants_map function in tenant/utils.py file
- Implement your tenant schema:
docker-compose exec api-server python3 manage.py migrate_tenant_schemas
- Create a superuser from the console to your tenant_name:
docker-compose exec api-server python3 tenant_context_manage.py tenant_name createsuperuser
- Access the admin interface at
tenant_name.localhost:8000/admin