how can i make django url system acept the following url http://www.yoursite.com/notifications?topic=payment&id=identificador-de-notificación-de-pago

21 views
Skip to first unread message

Matias Araujo

unread,
Jul 16, 2014, 5:24:30 PM7/16/14
to django...@googlegroups.com
Hi all! im devoloping a site in django and i need to recive an http request with an url of this type:
 http://testsystemser.cloudapp.net/pago/index?topic=payment&id=identificador-de-notificación-de-pago 
but i cant make it match with my urlconf in my project, i try with the following ur:
url(r'pago/index/(?P<topic>\w)/(?P<id>\w)', 'apps.pagos.views.index', name='index'),
l but it didnt match so i cant handle the request and recive the information i need.

alghafli

unread,
Jul 16, 2014, 6:18:22 PM7/16/14
to django...@googlegroups.com
You should stop at /pago/index
the fields after ? are accessible by the GET dictionary.
I did something like this and I used (r'^search/$') expression. when I get a url like:
http://testsystemser.cloudapp.net/search/?topic=payment&id=identificador-de-notificación-de-pago
I do something like this in the view function:
def search (request):
    topic = request.GET['topic']
    id = request.GET['id']
    #do more stuff


hope this helps
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6303a363-cd4d-47cc-af1c-ea804dd77a3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Evans

unread,
Jul 16, 2014, 6:24:11 PM7/16/14
to django...@googlegroups.com
In addition to what the other poster said, you have "pago/index/" in
your urls.py, but in the url you are trying to match it against, you
have "pago/index". These two strings are not the same, so it would not
match.

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages