On Mon, Apr 26, 2010 at 10:16 PM, Daniel Klein <bri...@gmail.com> wrote:
> Hi,
>
> I'm trying to avoid hardcoding a URL in a redirect call, but I can't
> for the life of me make redirect work. The relevant code segments
> first:
>
> From urls.py:
>
>        url(r'^game/(\d+)/$', 'views.game', name='gameview'),

                            ^^^ This is a positional argument

>
> From the view:
>
>                        return redirect("gameview", id = newgame.id)

                            ^^^ This is a named argument

>
>
> The error I get is:
>
> NoReverseMatch at /prelobby/
> Reverse for 'gameview' with arguments '()' and keyword arguments
> '{'id': 24}' not found.

    ^^^^ This is it explaining that to you :)

Either change the URL to use a named argument as Javier suggested, or
use positional arguments, eg:

  reverse('some_name', args=[arg1,arg2])

Cheers

Tom

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

Reply via email to