All the demos and guides shows how to access cloud datastore from python on GCE or from local machine, but is it possible to access cloud datastore from python hosted on a GAE ?
from gcloud import datastore
import os
import webapp2
# dataset = datastore.get_dataset(
# 'appid',
# '[email protected]',
# os.path.abspath("appid.p12"))
#
# entity = dataset.entity('People')
# entity['name'] = 'helloworld'
# entity['age'] = 25
# entity.save()
# print 'Hello, world!'
class MainPage(webapp2.RequestHandler):
def get(self):
dataset = datastore.get_dataset(
'appid',
'[email protected]',
os.path.abspath("appid.p12"))
entity = dataset.entity('People')
entity['name'] = 'helloworld'
entity['age'] = 25
entity.save()
self.response.out.write('Hello')
application = webapp2.WSGIApplication([
('/', MainPage)
], debug=True)
If anyone has this working on appengine please share. Thanks
All the demos and guides shows how to access cloud datastore from python on GCE or from local machine, but is it possible to access cloud datastore from python hosted on a GAE ?
I don't seem to get this working. like https://cloud.google.com/appengine/docs/python/gettingstartedpython27/helloworld
If anyone has this working on appengine please share. Thanks