mahesh_aka_amol wrote:
> Parameter not getting passed to view function
>
> upon accessing http://localhost:8000/hello/TEST it merely prints
> "hello there" instead of "hello there TEST"
>
> urls.py
>     (r'^hello/(?P<who>)\S+/$', 'swamiji.poll.views.hello')
>
>
> Views.py
>
> def hello(request, who):
>       return HttpResponse("hello there %s" % who)
>
>   
>>> m = re.match(r'^hello/(?P<who>)\S+/$', "hello/TEST/")
>>> print m.group("who")

>>> print m.group(0)
hello/TEST/

The problem is not that your URL pattern isn't matching, it's that the
named group matches the empty string and TEST is matched by the "\S+".

regards
 Steve


--~--~---------~--~----~------------~-------~--~----~
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