Pass request.user to view without altering the url

后端 未结 3 741
死守一世寂寞
死守一世寂寞 2021-01-22 17:50

I\'m trying to write a view where the current logged in user\'s information is retrieved.

My view is written as below, and it works perfectly fine as long as I pass the

3条回答
  •  生来不讨喜
    2021-01-22 18:35

    The logged in user object is in the request object too. use: request.user

    see more info in the django auth docs

提交回复
热议问题