google-app-engine

Flask-SQLAlchemy & Google App Engine - no permission to write

北城余情 提交于 2021-01-28 13:50:13
问题 Main.py from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config['SECRET_KEY'] = '123' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) class User(db.Model): __table_name__ = 'user' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), unique=True) password = db.Column(db.String(80)) def __init__(self, username, password): self.username = username self.password =

Problem with Python relative paths when deploying to Google App Engine Flexible

☆樱花仙子☆ 提交于 2021-01-28 12:49:01
问题 I have simple Python app I'm trying to deploy to App Engine. The app runs perfectly in my local environment. I've been struggling for hours with absolute and relative paths. I have the following simple filter in the /utils folder, filters.py file: from .. import app @app.template_filter() def nicedate(datestring): datestring=datestring[:10] return datestring When running my app, I get the following error: from .. import app ValueError: attempted relative import beyond top-level package That's

How to access process.env on Google App Engine with Nodejs

余生颓废 提交于 2021-01-28 08:48:49
问题 I'm using react on google app engine. As is written in the documentation: https://cloud.google.com/appengine/docs/standard/nodejs/runtime#environment_variables I can access the following Env Variable: Environment variable Description GAE_APPLICATION The ID of your App Engine application. GAE_DEPLOYMENT_ID The ID of the current deployment. GAE_ENV The App Engine environment. Set to standard. GAE_INSTANCE The ID of the instance on which your service is currently running. GAE_MEMORY_MB The

How to download all nltk data in google cloud app engine?

假如想象 提交于 2021-01-28 08:31:20
问题 I have a django application which I have deployed using below link, https://cloud.google.com/python/django/flexible-environment But as I am using nltk for text processing, I am getting below error. ********************************************************************* Resource 'taggers/maxent_treebank_pos_tagger/PY3/english.pickle' not found. Please use the NLTK Downloader to obtain the resource: >>> nltk.download() Searched in: - '/root/nltk_data' - '/usr/share/nltk_data' - '/usr/local/share

Multiple Services in Google App Engine Python 3.7

眉间皱痕 提交于 2021-01-28 08:30:10
问题 I have an application that ran fine under the Python 2.7 Standard framework, and runs fine as two separate applications in the 3.7 framework, but I can't figure out how to configure them as a single application with two services. main.app consists of the following two lines (paralleling what used to work in the 2.7 framework) from app import app from update import update The app.yaml for main consists of nothing but runtime: python37 Each of the two python packages under main (app and update)

Content-length header not being set on Flask App Engine response for served blob

…衆ロ難τιáo~ 提交于 2021-01-28 08:04:15
问题 In my Flask-based Google App Engine server, I am trying to return a response with a 'content-length' header which will contain the final size of a blob being served to the client. This blob is a large media file, so this header is going to be used to set the maximum value of a progress bar on the UI frontend. The blob lives in Cloud Storage, but is using the blobstore API from the App Engine packages to retrieve the blob. Below returns with a 200 status code: response.headers['Content-length'

Google Cloud Logging Handler Not Found

不问归期 提交于 2021-01-28 07:06:36
问题 My google app engine local development server returns a classdef not found exception when I point the logger to google clouds logging handler, how do I fix this? INFO: Dev App Server is now running Can't load log handler "com.google.cloud.logging.LoggingHandler" java.lang.ClassNotFoundException: com.google.cloud.logging.LoggingHandler java.lang.ClassNotFoundException: com.google.cloud.logging.LoggingHandler at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader

Stackdriver Alerting Policy - Need To Filter On JSON Payload

瘦欲@ 提交于 2021-01-28 05:25:09
问题 I have a Python script set up under App Engine that runs through all of the projects within our organisation that collects data on: The disks not associated with snapshot policies The snapshot policies that do not have "daily" or "weekly" in their name (and are thus outside our naming convention) Taking the former as the example, the JSON payload within the Stackdriver log is like: jsonPayload: { DiskWithoutPolicy: "True" diskId: "1234567891234567891" diskName: "server-disk3" project:

How to check if NDB model is valid

◇◆丶佛笑我妖孽 提交于 2021-01-28 05:11:06
问题 I have a model class like: class Book(ndb.Model): title = ndb.StringProperty(required=True) author = ndb.StringProperty(required=True) and I have some code using this: book = Book() print book >> Book() book_key = book.put() >> BadValueError: Entity has uninitialized properties: author, title Is there a way to check if model is valid before saving it? And finding out which property is invalid and the type of error (e.g. required). And if you have structured property how will this work then?

Pulling data from datastore and converting it in Json in python(Google Appengine)

末鹿安然 提交于 2021-01-28 03:02:14
问题 I am creating an apllication using google appengine, in which i am fetching a data from the website and storing it in my Database (Data store).Now whenever user hits my application url as "application_url\name =xyz&city= abc" ,i am fetching the data from the DB and want to show it as json.Right now i am using a filter to fetch data based on the name and city but getting output as [ ].I dont know how to get data from this.My code looks like this: class MainHandler(webapp2.RequestHandler): def