I am making a page in Django. The model is from a Product that has a Brand. The problem is that, I want to show all the brands in the nav so only the products of that brand are shown. I was able to do it but I had to put this code in all the views:
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['marca_list'] = Marca.objects.all()
return context
Is there a way to do this in a single view and have it included in the nav?
The solution used was to use context_processors
Here I leave a video with all the explanation