I'm writing a django project that will require me to route queries to certain large databases based on the user selection.
So all the tables for django.contrib.auth and session and stuff will be in the 'central' database, as well as a table that maps users to which database they need to use for the main app.
Can you help me come up with a way of routing database queries this way using a Django database router?
Log in user form has the database selection option.If the user is a valid user , then he will be connected to the his selected DB
At the start of the view could I take the logged in user from request.user or wherever it is, and some how provide that variable to my database router for the rest of the request?
All suggestions welcome.