V
V
Villian_Os2020-08-05 10:45:30
Django
Villian_Os, 2020-08-05 10:45:30

How to pass the name of the authorized user in views.py?

Hello, I ran into a problem that I can not pass the user who logged in to the view. In the template, if I write {{request.user}}, then it gives out a name, but I don’t understand how to pass it to the view. Read the documentation, did not find the answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-08-05
@Villian_Os

The view either has request (function-based) or self.request (class-based) in its arguments

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question