{"repo":"adamghill/dj-lite-tenant","free":true,"listed":false,"github":"https://github.com/adamghill/dj-lite-tenant","clone":"git clone https://github.com/adamghill/dj-lite-tenant.git","description":"Multi-tenant SQLite databases for Django.","language":"Python","stars":30,"topics":["django","sqlite"],"license":null,"category":"databases-storage","readme_excerpt":"dj-lite-tenant Per-user SQLite databases for Django for ultimate multi-tenant isolation. Status: Very experimental, but it works. Not intended for production use yet. Forked from django-sqlite-user-db by MessyComposer. --- Features - Per-user SQLite databases, created automatically for ultimate isolation - Configurable settings for tenant databases (with performant defaults) - Cross-database joins work with Django's ORM and raw SQL queries - The correct tenant database is automatically used based on the current user - Sync and async support - Optional database template creation for fast tenant provisioning - Django admin integration to access different user's database for superusers Installation OR settings.py How it works Multi-tenant request flow Each authenticated user gets their own isolated SQLite file for the apps/models specified in the APPS setting. The middleware resolves the correct tenant on every request, the router directs ORM queries to the right file, and the LRU registry manages open connections. Cross-database joins (ATTACH DATABASE) When a tenant model has a ForeignKey to a shared model (e.g. Note.user → auth user ), each shared database listed in ATTACHMENTS is ATTACHed to the tenant connection as a read-only alias. The custom SQLite backend rewrites dotted table names so the Django ORM generates valid cross-file SQL. Settings DIR The directory where per-tenant SQLite databases are stored. APPS Defines which apps or specific models should be stored in tenan","default_branch":null,"files":null,"tree":[],"storefront":"/r/adamghill","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/adamghill/dj-lite-tenant/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}