Reputation: 135
I am looking for some assistance on how to implement dynamic html content using blostore api with Google Cloud Storage. Currently our site rely's on CloudStorage where all our static content (html5) is stored, which we call and serve using the blobstore api. That way the content owners can independently upload html/image/swf content on their own to CloudStorage.
Currently content is all static, and we now want to pass in data from our CloudSQL such as "seen the page" which we will pull from our CloudSQL DB as well as other data for example from the AppEngine userservice. The code below shows how we do it now with the blobstore api:
gs_filename = '/gs/%s/%s' % (settings.BUCKET, filename)
bkey = blobstore.create_gs_key(gs_filename)
return blobstore_dh.send_blob(bkey, content_type=ct)
My question is, how can I pass in data from the CloudSQL DB to the HTML that currently is hosted on CloudStorage still using the blobstore api? Content is all static, and it needs to become more dynamic using django for example as the framework.
I'm not grasping how this is feasible currently using the blobstore api. Any ideas on how to implement this? Thanks for your time.
Upvotes: 1
Views: 119
Reputation: 76541
You need to use the BlobReader class to read the data from the blob, transform the data however you want and then send the transformed data yourself.
Upvotes: 1