【发布时间】:2015-05-28 04:27:00
【问题描述】:
我正在更新一个使用 direct_to_template 作为函数的 Django 项目,即:
return direct_to_template(request, 'bprofile/init.html', targs)
如前所述this page
我看过SO question here 并阅读了documentation on this page,其中描述了表单语句的迁移
('^about/$', direct_to_template, {'template': 'about.html'})
看起来像
('^about/$', TemplateView.as_view(template_name='about.html'))
不幸的是,我似乎无法弄清楚如何将报表从我拥有的表格更改为一个有效的新表格。
如何修改此代码以使用新的 Templateview 表单?
【问题讨论】: