# Django and multi-tenancy issue

**URL:** <https://forum.djangoproject.com/t/django-and-multi-tenancy-issue/18730>\
**Category:** Forms & APIs\
**Created:** [February 9, 2023, 11:09am UTC](https://forum.djangoproject.com/t/django-and-multi-tenancy-issue/18730 "2023-02-09T11:09:27Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![pperliti](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/pperliti/32/11166_2.png) [@pperliti](https://forum.djangoproject.com/u/pperliti)\
**Post date:** [February 9, 2023, 1:07pm UTC](https://forum.djangoproject.com/t/django-and-multi-tenancy-issue/18730/7 "2023-02-09T13:07:57Z")

</div>

Ok, I’m missing a point.  
Let’s suppose I set tenant in a request header (some users might be anonymous, so I don’t know if sessions are a feseable idea). Since I’m also using the current tenant in other places other than requests (e.g. models’ Managers, custom templates’ Loaders, custom logging, …), thread\_local / ContextVars was a global common point to set/get the tenant. How can I make this info live outside the request?

---

_[View the full topic](https://forum.djangoproject.com/t/django-and-multi-tenancy-issue/18730)._
