1

When I run the django server and load the index page it says ...

Error:

'WSGIRequest' object has no attribute 'push'.

This is my code

def index(request):
    context_dict = {'boldmessage': "anything can b written here"}
    return render_to_response('rango/index.html', context_dict, request)
avenet
  • 2,894
  • 1
  • 19
  • 26
user2728494
  • 131
  • 1
  • 10

1 Answers1

2

remove the request when return .. It's should be

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

or use render instead

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

Note:

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

Raja Simon
  • 10,126
  • 5
  • 43
  • 74
  • Thanks rajasimon.It worked.I can't vote your answer as I'm running sort of reputations.:-) – user2728494 Jan 09 '15 at 13:24
  • @user2728494 if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – Raja Simon Jan 09 '15 at 13:26