How can i get the current user in a django template tags? (request object is not accessible)
Or how can i access to request object?
How can i get the current user in a django template tags? (request object
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to access the current user in a template tag, you must pass it as a parameter in the templates, like so:
Then make sure your template tag accepts this extra parameter. Check out the documentation on this topic. You should also check out simple tags.