hugobessa/django-shared-schema-tenants ? reverse-engineered prompt

Reverse engineered prompt

Build me a Django library for shared schema multi tenant apps, so I can keep one database schema and still isolate each tenant cleanly without a lot of extra work.

I want it to plug into an existing Django project easily, with a config class, URL setup, and middleware that figures out the active tenant from the request. It should support getting the tenant from the domain or from a specific HTTP header, and it should make it easy to read and save data as the current tenant without having to do everything manually.

Also, if some data should be shared across more than one tenant, I want that to be possible too, without duplicating records everywhere. Make it feel simple to use in normal Django code, and include a small example project and tests so I can see how it works. If you need to check current Django docs or best practices, look them up online first.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab