Hey Tiago,
> Exception Value: 'str' object has no attribute 'update'
It means that context_instance variable passed to render_to_string() is of
str type. context_instance needs to be an instance of
django.template.context.Context class.
Example use of render_to_string -
from django.template.loader import render_to_string
rendered = render_to_string('my_template.html', { 'foo': 'bar' })
Django docs -
https://docs.djangoproject.com/en/1.4/ref/templates/api/#the-render-to-string-shortcut
If interested, you can have a look at source code for Context class (
https://github.com/django/django/blob/1.4.3/django/template/context.py#L84).
Sincerely,
Pankaj Singh
http://about.me/psjinx
On Mon, Feb 18, 2013 at 12:04 AM, Tiago Carvalho <[email protected]>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/
>
> Request URL: http://localhost:8000/about/
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.