Sunday, March 27, 2011  direct_to_template generic view class-
based replacement for django 1.3  I was in love with
direct_to_template shortcut from django.views.generic.simple
Update: It was my lack of attention to the docs. new render
shortcut do the same thing as code below  It's extremely useful
to use direct_to_template instead of render_to_response because
there is no necessary to put RequestContext to
direct_to_template shourcut. But now it's deprecated so I
decided to replace it with small class-based view which do same
thing as old direct_to_template but – without restriction of new
TemplateView where is no way to put extra context.  from
django.views.generic.base import TemplateResponseMixin from
django.template import RequestContext  class
RenderTemplate(TemplateResponseMixin):     """django 1.3+ Class-
Based replacement for         context = {}         return
RenderTemplate.view(context, \             request=request,
template_name="main.html")     def view(cls, context,
render_args={}, **initkwarg