Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pass context data with templateview in django

class AboutView(TemplateView):
    template_name = 'about.html'

    def get_context_data(self, **kwargs):
        context = super(AboutView, self).get_context_data(**kwargs)
        context['dahl_books'] = Books.objects.filter(author="Dahl")
		return context
 
PREVIOUS NEXT
Tagged: #pass #context #data #templateview #django
ADD COMMENT
Topic
Name
3+5 =