gpt4 book ai didi

python - Django抛出错误 'WSGIRequest'对象没有属性 'push'

转载 作者:行者123 更新时间:2023-12-01 04:53:59 24 4
gpt4 key购买 nike

当我运行 django 服务器并加载索引页面时,它说......

错误:

'WSGIRequest' object has no attribute 'push'.

这是我的代码

def index(request):
context_dict = {'boldmessage': "anything can b written here"}
return render_to_response('rango/index.html', context_dict, request)

最佳答案

返回时删除请求..应该是

return render_to_response('rango/index.html',context_dict)

或者使用渲染代替

return render(request, 'rango/index.html', context_dict)

注意:

render() is the same as a call to render_to_response() with a context_instance argument that that forces the use of a RequestContext.

关于python - Django抛出错误 'WSGIRequest'对象没有属性 'push',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27861345/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com