google-app-engine-python

Datastore query without model class

半城伤御伤魂 提交于 2019-12-13 03:21:10
问题 I recently encountered a situation where one might want to run a datastore query which includes a kind, but the class of the corresponding model is not available (e.g. if it's defined in a module that hasn't been imported yet). I couldn't find any out-of-the-box way to do this using the google.appengine.ext.db package, so I ended up using the google.appengine.api.datastore.Query class from the low-level datastore API. This worked fine for my needs (my query only needed to count the number of

ImportError: cannot import name sandbox

一世执手 提交于 2019-12-12 04:46:05
问题 Over the past couple days, this has started cropping up whenever I run dev_appserver.py : from google.appengine.tools.devappserver2.python import sandbox ImportError: cannot import name sandbox Since I was primarily coming across this in the setup of a new environment, I figured it must be a mistake of mine during setup. After enough head-scratching over the past 3 hours, I figured it couldn't be in the new setup, so I loaded up dev_appserver.py in a known-to-be-working environment. Yet again

Google Cloud Debugger for Python App Engine module says “Deployment revision unknown”

[亡魂溺海] 提交于 2019-12-12 03:55:42
问题 I'm trying to get the Google Cloud Debugger to work on my Python App Engine module. I've followed the instructions and: Connected to my Bitbucket hosted repository. Generated the source-context.json and source-contexts.json using gcloud preview app gen-repo-info-file Uploaded using appcfg.py update However when I try to set a snapshot using the console, there is message saying: The selected debug target does not have source revision information. The source shown here may not match the

GAE: How to rollback a transaction?

情到浓时终转凉″ 提交于 2019-12-12 03:28:54
问题 I just read this great summary of GAE best practices: https://cloud.google.com/datastore/docs/best-practices One of them is: If a transaction fails, ensure you try to rollback the transaction. The rollback minimizes retry latency for a different request contending for the same resource(s) in a transaction. Note that a rollback itself may fail, so the rollback should be a best-effort attempt only. I thought that transaction rollback was something that GAE did for you, but the above quote says

Define common files for GAE projects

倾然丶 夕夏残阳落幕 提交于 2019-12-12 03:22:19
问题 I have two different projects in Google app engine account. The folders structure in my computer is as following: parent_folder common_folder project1_folder project2_folder I have few python classes in common_folder that I want to use in both projects (project1 and project2). I want to import the common classes into my projects, so Google App Engine will recognize them also on Production env (maybe GAE can create a copy of the common files when uploading?) I tried using the following code in

Django - SendMail on Google App Engine Flexible ENV

风流意气都作罢 提交于 2019-12-11 15:28:57
问题 Can anyone tell me how to configure a Django app running on Google App Engine Flexible environment to send out emails? We are trying to send confirmation emails to users (we are using django-allauth) during account/signup. Our attempts to configure App Engine for send mail is not working. We have wasted four whole days on this supposedly simple matter. This is our current Django settings: EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST

ImportError: No module named google.cloud.error_reporting

我的未来我决定 提交于 2019-12-11 15:18:05
问题 A few weeks ago I've installed Ubuntu 18.10 at home and today I decided to move from Windows to this OS at home. I use it for Python development. Unfortunately, I faced with some strange error and don't know how to solve it. When I try to run my project I see next error during simple request File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime/sandbox.py", line 1154, in load_module raise ImportError('No module named %s' % fullname)

Monitoring the status of a google pub/sub submitted job

旧城冷巷雨未停 提交于 2019-12-11 12:54:31
问题 I am new to Google Compute/Google App Engine platform. I am currently migrating a python flask application using celery for async tasks to Google Compute/Google App Engine platform. However in the docs it's written I should use Google Pub/Sub instead of celery. In my application whenever I run an async task I have a page to monitor the status of the job using the same principle as http://blog.miguelgrinberg.com/post/using-celery-with-flask. I have checked the documents for google pub/sub, but

Change runtime from Python to Go in App Engine standard environment

瘦欲@ 提交于 2019-12-11 08:46:54
问题 I have a website on AppEngine that is 99% static. It is running on Python 2.7 runtime. Now the time has come to evolve this webapp, and since I have almost none Python code in it, I'd prefer to write it in Go instead. Can I change runtime from Python 2.7 to Go, while keeping the project intact? Specifically, I want to keep the same app-ID, the same custom domain attached to it, the same SSL certificate, and so on. What do I have to do in order to do that? I surely have to change runtime in

query in datastore without a model

隐身守侯 提交于 2019-12-11 07:31:48
问题 I am trying to create an application in appengine that searches for a list of keys and then I use this list to delete these records from the datastore, this service has to be a generic service so I could not use a model just search by the name of kind, it is possible to do this through appengine features? Below my code, but it requires that I have a model. import httplib import logging from datetime import datetime, timedelta import webapp2 from google.appengine.api import urlfetch from