Well, this bit me a while back when I svn-up'ed from trunk and I got
fed up of changing my django.pth to point to trunk_r7971, so I was
determined to get it sorted out.

The first thing is that the NoReverseMatch error seems to be a catch-
all for a variety of exceptions, so if you can, check out your imports
as Koen outlines below.

However, I think that in this case it is far more likely that you have
some data that is triggering the NoReverseMatch exception, as you say
it happens randomly, and I think what is happening is your arguments
to {% url ... %} are not compatible with what your named url is
expecting to see.

This is what happened to me; my urls are of the form;

today/<group>/agenda

where <group> is letters (upper and lowercase), numbers and '-', so
these are valid stgp01, st2gp2-18 etc.

I used this match to begin with;
url(r'^today/(?P<group>[\w,-]+)/agenda$

from http://python.about.com/od/regularexpressions/a/regexprimer.htm
you can see that \w handles alphanumerics and _.

This is what killed it;

/today/st4gp8&9/agenda

With r7971 this would not have been a problem (well actually it would
have been a problem because the URL wouldn't work), but at least it
wouldn't give you an error. Now it does (it was changed in r8211, see
http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges for
more details).

The solution for me was to include & and friends into the regex, so I
added \W as well (the above URL has details).

My final URL pattern is url(r'^today/(?P<group>[\w,\W-]+)/agenda$ and
this works just fine.

I don't know what you're matching, but I'd hazard a guess that what
you're pumping out is not compatible with what your URL regex is
expecting to see.

This seems like a prime example of something that needs a slightly
more descriptive error message, but whether that's possible or not, I
don't know (I did dig around in urlresolvers.py, but it went rapidly
over my django-fu).

Hope this helps,
Tone

On Aug 25, 8:40 pm, koenb <[EMAIL PROTECTED]> wrote:
> I guess you are seeing the bug reported in #6379. You probably have an
> import error somewhere, but it is being hidden by theNoReverseMatch
> exception that is raised for anything that goes wrong.
>
> Koen
>
> On 25 aug, 16:13, Robin <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
>
> > i have the same exception and exactly as Julien explained in the dev
> > server works fine ... and also works fine with fast_cgi, but I am
> > using apache + mod_wsgi and it didn't work with the same problem:
> >NoReverseMatch
>
> > Has any of you any clue to this error ?
>
> > thanks in advance,
> >         r
>
> > On Aug 16, 8:16 pm, Alberto Piai <[EMAIL PROTECTED]> wrote:
>
> > > On Aug 16, 12:01 am, Julien Phalip <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > It's likely that there is a typo somewhere in your templates, either
> > > > you didn't write the view name properly, or you didn't provide the
> > > > right parameters.
> > > > In the error message, there should be the name of the view. Look up
> > > > every occurrence et double check that you haven't made any typo.
>
> > > I'm checking everything again. But actually I don't think the
> > > problem's there, as everything works fine when run from django's dev
> > > server, and now it's been working fine for some hours even on lighttpd
> > > +fcgi. When the problem appears again I'll send the traceback.
>
> > > Thanks for you help,
>
> > > Alberto
--~--~---------~--~----~------------~-------~--~----~
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