扫码关注官方订阅号
学习是最好的投资!
render是渲染变量到模板中,而redirect是HTTP中的1个跳转的函数,一般会生成302状态码
render_to_response('current_datetime.html', {'current_date': now})//第一个参数是模板页面,第二个参数是变量return HttpResponseRedirect("your url")//直接跳转到指定url
这就是区别
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
render是渲染变量到模板中,而redirect是HTTP中的1个跳转的函数,一般会生成302状态码
render_to_response('current_datetime.html', {'current_date': now})//第一个参数是模板页面,第二个参数是变量
return HttpResponseRedirect("your url")//直接跳转到指定url
这就是区别