from django.shortcuts import render_to_response from django.template import RequestContext from django.views.generic import View as DjangoView class View(DjangoView): section = None data = {} def __init__(self, *args, **kwargs): self.data['section'] = self.section return super(View, self).__init__(*args, **kwargs) class HomepageView(View): template = 'homepage.jinja' section = 'homepage' def get(self, request): context = RequestContext(request, self.data) return render_to_response(self.template, context_instance=context)