I had one yesterday that took a while to figure out.
Every page that I visited gave me a similar error. Something like this :
Request Method:         GET
Request URL:    [host]/db/camps/
Exception Type:         SyntaxError
Exception Value:        invalid syntax (views.py, line 76)
Exception Location:
/usr/lib/python2.4/site-packages/django/core/urlresolvers.py in
_get_callback, line 125

With this traceback :
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/template/__init__.py" in
render_node
  723. result = node.render(context)
File "/usr/lib/python2.4/site-packages/django/template/defaulttags.py" in
render
  329. return reverse(self.view_name, args=args, kwargs=kwargs)
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
reverse
  241. return '/' + resolver.reverse(viewname, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
reverse
  212. return pattern.reverse_helper(lookup_view, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
reverse_helper
  223. sub_match = self.reverse(lookup_view, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
reverse
  215. elif pattern.callback == lookup_view:
File "/usr/lib/python2.4/site-packages/django/core/urlresolvers.py" in
_get_callback
  125. self._callback = getattr(__import__(mod_name, {}, {}, ['']),
func_name)

  SyntaxError at /db/camps/
  invalid syntax (views.py, line 76)

One at least one occasion, I also got pointed to a {% url [...] %} in a
template.

The error turned out to indeed be at line 76 of one of the views.py files,
but not the one in db/camps (that's from the URL I was trying to access).

With 4 apps, it could be any one of the 4 views.py files.

It was made harder to find by the fact that "manage.py validate" said that I
had no errors.

If I'd been given the full path to the views.py with the error, it would
have been much easier to track this down (that seems likely to be available,
but I don't know for sure).

(For the curious, I'd missed a comma between two parameters where I called
render_to_response()).

Chris Brand




--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to