On Friday, 23 December 2011 17:17:50 UTC, lankesh87 wrote:
>
> Hi,
>
> I am trying to handle a callback url. Following is the code in my
> urls.py file:
>
> --------------------------------------------------------------------------------------
>
>
> urls.py:-
> --------------------------------------------------------------------------------------
>
>
>
> from django.conf.urls.defaults import *
>
> # Uncomment the next two lines to enable the admin:
> #from django.contrib import admin
> #admin.autodiscover()
>
> urlpatterns = patterns('',
> # Example:
> (r'^tweet/', 'tweety.views.twitter_tweet'),
>
> #in the next line i wish to handle the callback url:-
> (r'^return/(?P<qqq>\)', 'tweety.views.twitter_return'),
>
> # Uncomment the admin/doc line below to enable admin
> documentation:
> #(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> # Uncomment the next line to enable the admin:
> #(r'^admin/', include(admin.site.urls)),
> )
>
>
> --------------------------------------------------------------------------------
>
>
>
> In my twitter app i have given callback url as:
>
> "http://127.0.0.1:8001/return/"
>
> but the actual url has some added parameters. Something like this:
>
> "http://127.0.0.1/return/?
> oauth_token=SOME_VALUE&oauth_verifier=SOME_VALUE<http://127.0.0.1/return/?oauth_token=SOME_VALUE&oauth_verifier=SOME_VALUE>"
>
>
>
> SOME_VALUE is alphanumeric.
>
> Now all I need is how to handle this url in Regular Expression
>
> Thanks in advance.
>
As the documentation[1] clearly explains, GET parameters (those after the
?) are not matched in the URLconf. Get them in the view, with request.GET.
[1]:https://docs.djangoproject.com/en/1.3/topics/http/urls/#what-the-urlconf-searches-against
---
DR.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/1As-_VRcDxIJ.
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=en.