博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
render()方法是render_to_response
阅读量:4683 次
发布时间:2019-06-09

本文共 388 字,大约阅读时间需要 1 分钟。

自django1.3开始:render()方法是render_to_response的一个崭新的快捷方式,

前者会自动使用
RequestContext。而后者必须coding
出来,这是最明显的区别,当然前者更简洁。 return render_to_response('blog_add.html',{'blog': blog, 'form': form, 'id': id, 'tag': tag}, context_instance=RequestContext(request)) return render(request, 'blog_add.html', {'blog': blog, 'form': form, 'id': id, 'tag': tag})

转载于:https://www.cnblogs.com/wspblog/p/6152871.html

你可能感兴趣的文章
halt和shutdown 的区别
查看>>
git常用操作
查看>>
京东SSO单点登陆实现分析
查看>>
render()方法是render_to_response
查看>>
u-boot启动第一阶段
查看>>
北京大学2019年数学分析考研试题
查看>>
MySQL批量SQL插入性能优化
查看>>
定义列属性:null,default,PK,auto_increment
查看>>
用户画像展示
查看>>
pyqt pyinstaller使用说明
查看>>
C#中StreamReader读取中文出现乱码
查看>>
引用堆中的对象
查看>>
用CSS开启硬件加速来提高网站性能(转)
查看>>
使用BufferedReader的时候出现的问题
查看>>
加快页面加载速度的方法
查看>>
Oozie协作框架
查看>>
linux安装图形界面
查看>>
Android广播发送失败
查看>>
博弈论之入门小结
查看>>
解决IE8下opacity属性失效问题,无法隐藏元素
查看>>