In a view
class, you could call self.request.user
and perform actions based on that. In my case, I would like to be able to switch databases depend
To resolve this, I created a new model with just one userid
field. Then in router when specifying db for read and write, I get the data from that model so I don't need any request argument.
And I just added a short ajax code in my base template so whenever my website is opened it gets the userid from request.user and change the model row so current user id is changed like so.