This may seem like a silly question but I can’t find anything to help.
How would you create a logout button on every view like the one available in the admin page?
This may seem like a silly question but I can’t find anything to help.
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.
Use templates inheritance:
https://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance
or include tag:
https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#include
Example with template inheritance:
We have a base template for all pages on our application:
base.html
other_pages.html
Now, we have a logout link on all pages inherited from the base.html
Example with include tag:
user_panel.html
other_pages
I recommend for a solution to your problem using template inheritance