I've looked at the relevant section of the Piston documentation, but it only seems to focus on how to turn it on, not what it would look like for clients or how to test it to verify it's working. The example only seems to use HTTP Basic and curl
. Finally, Ned Batchelder's question makes it look like a tutorial is in order. Thanks.
views:
1040answers:
3
+9
A:
I've just found one tutorial at http://blog.carduner.net/2010/01/26/django-piston-and-oauth/. Hope this would help someone.
xaralis
2010-03-27 13:28:05
The timing on this answer couldn't have been any better. Thank you!
Bryan Veloso
2010-03-27 19:54:44
A:
Did anyone manage to get the example documented in that blog working? I'm having problems integrating oauth and creating the necessary tokens. Does anyone have any pointers?
Benjamin Dell
2010-07-27 11:11:30
A:
I did benjamin dell; at what point are you? The endless loop? In that case; add this function to yourapp.api.views:
# Create your views here.
from django.shortcuts import render_to_response
from django.template import RequestContext
def request_token_ready(request, token):
error = request.GET.get('error', '')
ctx = RequestContext(request, {
'error' : error,
'token' : token
})
return render_to_response(
'piston/request_token_ready.html',
context_instance = ctx
)
and set settings.OAUTH_CALLBACK_VIEW = "api.views.request_token_ready"
GroteBozeWolf
2010-08-03 10:10:03