google-app-engine-python

How to ignore files when running `gcloud app deploy`?

纵饮孤独 提交于 2020-06-07 06:15:05
问题 When I run gcloud app deploy app.yaml which files actually get uploaded? The project folder contains folders and files such as .git , .git_ignore , Makefile or venv that are irrelevant for the deployed application. How does gcloud app deploy decide which files get uploaded? 回答1: tl;dr: you should use a .gcloudignore file, not skip_files in app.yaml . While the prior two answers make use of skip_files in the app.yaml file. There is now a .gcloudignore that is created when using gcloud deploy

No module named 'google.appengine' from within Cloud Shell

点点圈 提交于 2020-05-30 02:35:14
问题 I'm testing Google App Engine and trying to run a simple function to upload files to either the Blobstore or Cloud Storage. I'm typing the Python code directly in the Cloud Shell of my instance. The code is failing when I call: from google.appengine.ext import blobstore I get the error code: Traceback (most recent call last): File "upload_test.py", line 1, in <module> from google.appengine.api import users ImportError: No module named 'google.appengine' Even though the documentation says that

Disabling version specific urls in Google appengine

淺唱寂寞╮ 提交于 2020-05-16 20:33:07
问题 Google App-Engine supports version-specific routing of requests as documented here. This is useful for example for testing a new version prior to deploying it. However, this may also be problematic. Say the new version includes security enhancements - there should be a way to prevent access to previous versions without deleting them completely (in order to allow for quick roll-back for instance). Could not find a way to disable previous versions. Is there a way to accomplish that ? Thanks.

'gcloud deploy' complains about having both a .gcloudignore and skip_files even though I have neither

感情迁移 提交于 2020-05-15 05:09:22
问题 I'm trying to deploy a Django (v2.1) app to App Engines Python37 runtime. This is my app.yaml which was taken from a Google example: # [START django_app] runtime: python37 #api_version: 1 #threadsafe: yes handlers: - url: /static static_dir: static/ - url: .* script: <project_name>.wsgi.application # Only pure Python libraries can be vendored # Python libraries that use C extensions can # only be included if they are part of the App Engine SDK # Using Third Party Libraries: https://cloud

Google App Engine Python 3.7 build error: `pip_download_wheels` returned code: 1

半世苍凉 提交于 2020-02-21 22:50:09
问题 I am using Django REST Framework to deploy on Google App Engine and my requirements.txt file is as follows: asn1crypto==0.24.0 astroid==2.1.0 boto3==1.9.55 botocore==1.12.55 certifi==2018.8.13 cffi==1.11.5 chardet==3.0.4 colorama==0.4.1 coreapi==2.3.3 coreschema==0.0.4 cryptography==2.4.2 defusedxml==0.5.0 Django==2.1 django-allauth==0.36.0 django-filter==2.0.0 django-rest-auth==0.9.3 django-rest-swagger==2.0.7 djangorestframework==3.8.2 djangorestframework-jwt==1.11.0 docutils==0.14 idna==2

google cloud: downloading as an CSV

半腔热情 提交于 2020-02-08 02:30:25
问题 I have a download button that should return a users CSV. The code for it below: class StartCSVHandler(ThreeScaleResourceHandler): """ Starts generating a user's CSV file """ allowed_methods = ('new',) requires_input = False def post(self, *args, **kwargs): user = self.current_user() if not user: self.abort(401, detail=ERROR_NOT_AUTHORIZED) task_url = '/jobs/users/%s/data/csv' % user.key() taskqueue.add(url=task_url, queue_name='users') return {} def generate_data_from_query(query, user,

Not able to change the frontend instance class in appengine application

别等时光非礼了梦想. 提交于 2020-01-21 17:17:07
问题 Specified in app.yaml instance_class: F2 automatic_scaling: min_idle_instances: 5 max_idle_instances: automatic Is their any way out to check instance tier/class from developer console? Only able to guess instance class from billing status costing $0.05 per hour ie F1 instance class. 回答1: On the new console https://console.cloud.google.com, go to App Engine, then Versions. Under the dropdown More Columns, select Instance Class, then the instance class column will be displayed. 回答2: I could

Asynchronous requests in AppEngine

心已入冬 提交于 2020-01-16 03:25:07
问题 I'm building an app that essentially does the following: Get the user to enter certain parameters. Pass those params to the backend and start a task based on those params. When the task is complete redirect the user to another page showing the results of the task. The problem here is that the task is expected to take quite long. I was thus hoping to make the request asynchronous. Does appengine allow this ? If not, what are my options ? I was looking at the documentation for task queues.

How do I return data from a deferred task in Google App Engine

别等时光非礼了梦想. 提交于 2020-01-11 09:12:34
问题 Original Question I have a working version of my web application that I am trying to upgrade at the moment, and I'm running into the issue of having a task which takes too long to complete in during a single HTTP request. The application takes a JSON list from a JavaScript front end by an HTTP Post operation, and returns a sorted/sliced version of that list. As the input list gets longer, the sorting operation takes a much longer time to perform (obviously), so on suitably long input lists, I

How to import google cloud speech recognition in Google App Engine (python)

假装没事ソ 提交于 2020-01-11 06:50:52
问题 I want to use google.cloud library on my Google App Engine python application. In my local all my tests work since I installed this library on my local. I was expecting it to be supported in GAE by default but it's not supported. This the error I got: from google.cloud import speech ImportError: No module named cloud I had a look at adding 3rd party libraries at https://cloud.google.com/appengine/docs/standard/python/tools/using-libraries-python-27 After following the instructions I got