topless
topless

Reputation: 8221

How I can request a local url in my app engine application?

I am using Blobs to store json files for my application. What I am trying to achieve is to request an internal url of my application in order to get the relevant file. I have tried urllib, urllib2, urlfetch but every time I am getting a 5 second DeadlineExceededError: 5 timed out error. Is there a way to retrieve my blob in my get request or an alternative for retrieving my data?

Upvotes: 1

Views: 174

Answers (2)

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

This wouldn't on the development server (but will work on the production server) because its single threaded and you can't do a request to yourself from within a request.

There are several workarounds for your issue:

  1. Use the file write API to store the data.
  2. Use the multithread dev_server (required to switch to python 2.7 + HRD)
  3. Store the file asynchronously using queues or deferred.

Upvotes: 2

Nick Johnson
Nick Johnson

Reputation: 101149

You don't need to make HTTP requests to yourself in order to read data from the blobstore - you can simply use the BlobReader API.

Upvotes: 2

Related Questions