问题
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?
回答1:
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.
回答2:
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:
- Use the file write API to store the data.
- Use the multithread dev_server (required to switch to python 2.7 + HRD)
- Store the file asynchronously using queues or deferred.
来源:https://stackoverflow.com/questions/8915042/how-i-can-request-a-local-url-in-my-app-engine-application