citusdata / django-multitenant

Python/Django support for distributed multi-tenant databases like Postgres+Citus
MIT License
721 stars 119 forks source link

Document examples for where to add set_current_tenant #5

Closed saicitus closed 6 years ago

saicitus commented 6 years ago

Give some examples of where to include calls to set_current_tenant - whether as part of a middleware or as part of the individual views themselves.

gilsonbp commented 6 years ago

MIDDLEWARE example where I check if the logged-in user has a connection with some tenant before.

captura de tela 2017-12-19 as 11 27 23
saicitus commented 6 years ago

https://github.com/citusdata/django-multitenant#where-to-set-the-tenant