gae-python27

GAE python: how to use delete_serving_url

时光怂恿深爱的人放手 提交于 2019-12-24 00:06:02
问题 First I put image to storage: import cloudstorage as gcs ... path = '/bucket/folder/image.jpg' with gcs.open(path, 'w') as f: f.write(data) Then I get serving url: url = images.get_serving_url(None, filename='/gs{}'.format(self.path), secure_url=True) Serving url generally works as expected, the thing is I'm not using blob_key, only filename (path in storage). I wonder how to delete serving_url now, since sdk method only accepts blob_key def delete_serving_url(blob_key, rpc=None): """Delete a

Google App Engine configuring Endpoints API

旧时模样 提交于 2019-12-14 03:48:25
问题 I have a problem configuring Endpoints API. Any code i use, from my own, to google's examples on site fail with the same traceback WARNING 2016-11-01 06:16:48,279 client.py:229] no scheduler thread, scheduler.run() will be invoked by report(...) Traceback (most recent call last): File "/home/vladimir/projects/sb_fork/sb/lib/vendor/google/api/control/client.py", line 225, in start self._thread.start() File "/home/vladimir/sdk/google-cloud-sdk/platform/google_appengine/google/appengine/api

Cloud Datastore: ways to avoid race conditions

老子叫甜甜 提交于 2019-12-02 17:02:34
问题 I have lots of views manipulating entities of same kind: def view1(request, key): user = ndb.Key(urlsafe=key).get() user.x = 1 user.put() ... def view2(request, key): user = ndb.Key(urlsafe=key).get() user.y = 2 user.put() ... Obviously, this is error-prone due to possible race conditions (last wins): view1 reads whole user entity data (x=None, y=None) view2 reads whole user entity data (x=None, y=None) view1 user.x = 1 (x=1, y=None) view2 user.y = 2 (x=None, y=2) view1 user.put() (x=1, y

Cloud Datastore: ways to avoid race conditions

六月ゝ 毕业季﹏ 提交于 2019-12-02 09:56:47
I have lots of views manipulating entities of same kind: def view1(request, key): user = ndb.Key(urlsafe=key).get() user.x = 1 user.put() ... def view2(request, key): user = ndb.Key(urlsafe=key).get() user.y = 2 user.put() ... Obviously, this is error-prone due to possible race conditions (last wins): view1 reads whole user entity data (x=None, y=None) view2 reads whole user entity data (x=None, y=None) view1 user.x = 1 (x=1, y=None) view2 user.y = 2 (x=None, y=2) view1 user.put() (x=1, y=None) view2 user.put() (x=None, y=2) What are best ways to fix this and what behaviour is considered most