Monday, February 18, 2013

Re: Error passing data from views to template

return render_to_response('home/about.html', data, 'context_instance=RequestContext(request)')

Change that to:

return render_to_response('home/about.html', data, context_instance=RequestContext(request))

The context_instance is an optional keyword argument. Right now you're passing it as a positional string due to the quotes.

On Sunday, February 17, 2013 10:34:12 AM UTC-8, Tiago Carvalho wrote:
Hello,

I'm new to Django and I'm with an error, passing data from views to templates.

Here is the traceback: http://dpaste.com/942117/

Django Version: 1.4.3
Exception Type: AttributeError
Exception Value: 'str' object has no attribute 'update'
Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/loader.py in render_to_string, line 174


Somebody can help me, please?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate