Note: I’m not trying to provide a RESTful api, I’m trying to call one.
def index( request, *args, **kwargs ):
context = {}
context['some_json'] = make_remote_api_call( "http://exampl.com/objects/" )
return render_to_response( 'index.html', context, context_instance=RequestContext(request) )
Or is this just ridiculous and I should make the client always do it? Basically, I’m curious as to how to properly divide my website so that different servers (internal protected ones) can provide different subsets of info.
Use the requests library. Here is some discussion on it and I did a talk on “Consuming Web APIs with Python” at PyOhio that you might find interesting or helpful