[Answered ]-Making a universal view in Django

2👍

Don’t think you want a view called for every request. You will usually have separate view for different urls. You might want a way to some method which should be executed from every view.

eg: You might want a particular context to be present in all the template. In such case you should use TEMPLATE_CONTEXT_PROCESSORS.

If you only want a navbar present on all pages, you should either use template inheritance or use include tags. Check about extends and include tag in django templates.

Leave a comment