Django and multi-tenancy issue

This:

isn’t going to work.

In a full async environment, everything is running in the same thread. It’s not “one thread per connection”.

This also isn’t going to work with multiple workers, because each worker is running its own threads, thread pools, and event loops.

You need to either set this as a session variable or in a cache element associated with that session (effectively the same thing) or by setting a header in the request.