Threading and Async Views

2023-03-07 Thread Vasanth Mohan
Hello,

I'm currently building a multitenant service on django that uses a separate 
DB configuration per tenant. The frontend adds a unique header along with 
their requests so that the app can identify the tenant and select the DB to 
be used.

The catch is the tenant reference is stored as a thread local variable, so 
that the DatabaseRouter can use it. 

However, I am currently looking up async views to see if it can help 
optimise our apis. Will my thread-based logic clash with the ASGI async 
views ? 

Thanks
Vasanth M

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a2edc596-2c59-4ed2-8afe-9aff9c1ecb52n%40googlegroups.com.


Using Multiple databases

2022-04-06 Thread Vasanth Mohan
Hello,

I'm building a PoC for a multi-tenant app where I'm trying to use the same 
schema across multiple databases with Django instance. I've got a couple of 
questions and I'd be happy to have some input

1. Is there a way to define the *using()* function to use with Models via a 
lib/middleware?
2. Is there a way to create admin users so that they have access to 
specific databases? 

Regards,
Vasanth M

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e3b441eb-3855-4dc1-b9d7-ee7211add752n%40googlegroups.com.