[Answered ]-Render dynamic menu in every view

2👍

This is what context processors are for. You’re already using RequestContext, so you just need to define a function that returns your menu and add it to TEMPLATE_CONTEXT_PROCESSORS.

0👍

Depending on what version of django you are using, you might want to look into class based views or even class based generic views.

Otherwise you can also do something like:

def menu_view(request, template='menu.html', **kwargs)
    return render_to_response(template, kwargs, 
           context_instance = RequestContext(request))

I think kwargs should work just like that. Haven’t tested. If it doesn’t, make a dictionary out of it.

Leave a comment