On Thu, Nov 19, 2009 at 6:25 AM, Maksymus007 <[email protected]> wrote:
> I got my main urls.py file
>
> urlpatterns = patterns('',
> (...)
> (r'^wakers/$', include('appname.wakers.urls')),
> (...)
> )
>
> and this works well
>
> then i got wakers.urls.py
>
> urlpatterns = patterns('wakers',
> (r'^$', 'views.add', {}, 'wakers-add'),
> (r'^b$', 'views.add', {}, 'wakers-add2'),
> )
>
> And then in template i try to do
>
> {% url wakers-add %} everything works well, /wakers/ is returned
> but
> {% url wakers-add2 %} throws "Caught an exception while rendering:
> Reverse for 'wakers-add2' with arguments '()' and keyword arguments
> '{}' not found."
>
> which should work, just like the wakers-add.
>
>
No, wakers-add2 has no reverse because the pattern leading to wakers.urls
being considered requires that the url terminate with the slash after
wakers/. Remove the $ from the end of the pattern specification in the main
urls file and you will be able to reverse wakers-add2.
Karen
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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=.