【发布时间】:2010-05-22 04:16:55
【问题描述】:
我发现自己一遍又一遍地写同样的观点。基本上是这样的:
def home_index(request):
return render_to_response('home/index.html', RequestContext(request))
为了保持干燥的原则,我想使用generic view。我见过direct_to_template,但它传递了一个空上下文。那么我怎样才能在使用通用视图的同时仍然获得 RequestContext 的强大功能呢?
【问题讨论】:
标签: django django-views requestcontext