Baydashkin
Baydashkin

Reputation: 21

Changing request.user in Django

I need to view site from admin as another user. Now I'm just changing request.user in middleware. Is it safe or maybe there is more correct solution?

Thanks

Upvotes: 2

Views: 912

Answers (1)

user764357
user764357

Reputation:

Django packages has a list of apps that can handle user switching for you.

Depending on your requirements, just changing it in middleware is a relatively straight forward approach that some packages like django-masquerade takes.

Upvotes: 2

Related Questions