Monday, January 4, 2010

Re: Unhelpful template traceback

Yes, maybe thats more like the case.

Victor Lima

2010/1/4 Thomas Steinacher <tom@eggdrop.ch>
The actual error is not my point. I know that it's somewhere in a
reverse/url method, but there is no way I can test it. The point is
that there is no helpful template traceback in the deployment error e-
mails. Maybe I should direct this to django-developers instead or file
a ticket?

On Jan 4, 6:05 pm, Victor Loureiro Lima <victorloureirol...@gmail.com>
wrote:
> You are probably calling {{ model.property.url }} or {{
> model.get_absolute_url }} on some property/model (either FileField or
> ImageField in case of property) of some model of yours that doesnt know how
> to reverse back to its URL, so the template gives an error because it doesnt
> know how to render its own value. You should check if the models is correct
> and if its possible to access it thru the regex of URL.
>
>  Maybe if you iterate thru all objects trying to get_absolute_url them you
> could reproduce some sort of error.
>
> That would be my guess =)
>
> Victor Lima
>
> 2010/1/4 Thomas Steinacher <t...@eggdrop.ch>
>
>
>
> > Hey guys,
>
> > I sometimes get errors which occur rarely, so it is very difficult to
> > reproduce them in a development environment. The traceback always
> > looks similar to the traceback attached below (which is just an
> > example).
>
> > My question: How can I make the Django error mails show the template
> > file name and line number where the error occurred? It is really
> > annoying as I currently see no way to debug this type of errors other
> > than guessing, which is very difficult, especially when templates are
> > very complex.
>
> > Thanks,
>
> > Thomas
>
> > File "/home/mysite/django-mysite3/django/template/loader.py", line
> > 173, in render_to_string
> >  return t.render(context_instance)
>
> > File "/home/mysite/django-mysite3/django/template/__init__.py", line
> > 184, in render
> >  return self._render(context)
>
> > File "/home/mysite/django-mysite3/django/template/__init__.py", line
> > 178, in _render
> >  return self.nodelist.render(context)
>
> > File "/home/mysite/django-mysite3/django/template/__init__.py", line
> > 787, in render
> >  bits.append(self.render_node(node, context))
>
> > File "/home/mysite/django-mysite3/django/template/__init__.py", line
> > 800, in render_node
> >  return node.render(context)
>
> > File "/home/mysite/django-mysite3/django/template/defaulttags.py",
> > line 384, in render
> >  raise e
>
> > NoReverseMatch: Reverse for 'view_user_pictures' with arguments '()'
> > and keyword arguments '{'username': ''}' not found.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscribe@googlegroups.com<django-users%2Bunsubscribe@google groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

--

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



--

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate