Your Django ORM protects tenant data. Your raw SQL doesn't. š¬
That's why I built django-rls-tenants ā multitenancy powered by PostgreSQL Row-Level Security, enforced at the database level.
š Every query is filtered ā ORM, raw SQL, even dbshell
š« Missing tenant context? Zero rows returned, never a data leak
š¦ Single schema, no connection routing headaches
ā” Drop-in: one base model, one middleware, done
Unlike schema-based or ORM-rewriting approaches, RLS policies live in PostgreSQL itself. The database becomes your last line of defense ā not your app code.
Supports Python 3.11+, Django 4.2ā6.0, PostgreSQL 15+.
Just shipped v1.0.0 š
pip install django-rls-tenants
š Docs & source: https://github.com/dvoraj75/django-rls-tenants
Feedback, stars & contributions welcome! ā
#Django #Python #PostgreSQL #MultiTenancy #RowLevelSecurity #OpenSource #WebDev #SaaS #InfoSec #Database

GitHub - dvoraj75/django-rls-tenants: Database-enforced multitenancy for Django using PostgreSQL Row-Level Security. Every query -- ORM, raw SQL, dbshell -- is filtered by the database itself. Zero data leaks by design
Database-enforced multitenancy for Django using PostgreSQL Row-Level Security. Every query -- ORM, raw SQL, dbshell -- is filtered by the database itself. Zero data leaks by design - dvoraj75/djang...


