google-app-engine

Python ImportError: No module named main in Google app engine project

最后都变了- 提交于 2021-02-07 19:07:14
问题 I have the following app.yaml file application: gtryapp version: 1 runtime: python27 api_version: 1 threadsafe: yes handlers: - url: /images/(.*\.(gif|png|jpg)) static_files: static/img/\1 upload: static/img/(.*\.(gif|png|jpg)) - url: /css/(.*\.css) mime_type: text/css static_files: static/css/\1 upload: static/css/(.*\.css) - url: /js/(.*\.js) mime_type: text/javascript static_files: static/js/\1 upload: static/js/(.*\.js) - url: /(.*\.html) mime_type: text/html static_files: static/\1

Is there a way to specify a projection for ndb.get_multi()?

余生颓废 提交于 2021-02-07 18:42:49
问题 Using NDB, it is possible to specify a projection for a query, allowing to limit the number of properties that are retrieved for the entities that match the query. However, I couldn't find anything in the documentation about how to specify a projection when using ndb.get_multi() , which always fetches complete entities. Is there a way to fetch only certain properties when using ndb.get_multi() ? 回答1: No, the projection feature only works for queries. There would be no advantage (in terms of

Servlet asynchronous processing support in App Engine Java 8 standard environment

半城伤御伤魂 提交于 2021-02-07 13:55:15
问题 I'm trying asynchronous processing support in servlet 3.1 with GAE J8 standard environment (no extensible environment). Basically I have a servlet annotated with @WebServlet(name = "MyServletName", urlPatterns = {"/dosomething"}, asyncSupported = true) and to obtain an instance of AsyncContext I call (in doPost method) final AsyncContext asyncContext = httpServletRequest.startAsync(httpServletRequest, httpServletResponse); But asynchronous processing support seems to have some problems in GAE

How can I impersonate a user of AppEngine java application operating in G-Suite domain?

人盡茶涼 提交于 2021-02-07 12:14:06
问题 My standard AppEngine application needs to perform changes in a Google Sheet documents (among others). To achieve this, I need to obtain a credential for service account, and somehow configure that it should act in behalf of a user. This method allows gives me default service account credentials: private static GoogleCredential getDefaultServiceAccountCredential() throws IOException { return GoogleCredential.getApplicationDefault() .createScoped(MY_SCOPES); } but it does not work in behalf of

How can I impersonate a user of AppEngine java application operating in G-Suite domain?

点点圈 提交于 2021-02-07 12:12:55
问题 My standard AppEngine application needs to perform changes in a Google Sheet documents (among others). To achieve this, I need to obtain a credential for service account, and somehow configure that it should act in behalf of a user. This method allows gives me default service account credentials: private static GoogleCredential getDefaultServiceAccountCredential() throws IOException { return GoogleCredential.getApplicationDefault() .createScoped(MY_SCOPES); } but it does not work in behalf of

Determine what project id my App Engine code is running on

不羁岁月 提交于 2021-02-07 11:39:28
问题 From within an App Engine app, is there a way to determine the project ID a GAE (App Engine) instance is running on? I want to access a big query table in the same project that the App Engine instance is running in. I'd rather not hard code it in or include it in another config file if possible. Edit: forgot to mention that this is from Python 回答1: You can get a lot of info from environment variables: import os print os.getenv('APPLICATION_ID') print os.getenv('CURRENT_VERSION_ID') print os

How do I manually set the severity of a Google App Engine request log?

情到浓时终转凉″ 提交于 2021-02-07 10:19:54
问题 I have an app in the Google App Engine Python 3 Standard Environment. I have it set up to group log entries by their request, as described in Writing Application Logs (in the "Viewing related request log entries" section). That page notes: The highest severity from the "child" log entries does not automatically apply to the top-level entry. If that behavior is desired, manually set the highest severity in the top-level entry. The top-level entry in question is the request log that App Engine

How do I manually set the severity of a Google App Engine request log?

£可爱£侵袭症+ 提交于 2021-02-07 10:16:32
问题 I have an app in the Google App Engine Python 3 Standard Environment. I have it set up to group log entries by their request, as described in Writing Application Logs (in the "Viewing related request log entries" section). That page notes: The highest severity from the "child" log entries does not automatically apply to the top-level entry. If that behavior is desired, manually set the highest severity in the top-level entry. The top-level entry in question is the request log that App Engine

Parallel Module Deployment using App Engine SDK

坚强是说给别人听的谎言 提交于 2021-02-07 09:29:30
问题 TL;DR Is there a way to deploy App Engine modules in parallel? I've built a go application using Google's App Engine SDK for Go. This application defines multiple modules. These modules are self-contained, and do not require any sort of dependency across other modules. When I attempt to deploy the modules to the Google Cloud, I can't help but notice that the modules are uploaded sequentially. This would be fine if deployment was relatively quick, but each module requires it's own redundant

Google App engine can not see my CSS files

邮差的信 提交于 2021-02-07 09:26:27
问题 Google Appengine I am working on a Google App engine project but i cannot see my css.The code just appears plain. My styles can not be seen on the html page. My app.yaml file is as shown below: application: paymentgateway version: 1 runtime: python api_version: 1 handlers: - url: .* script: main.py - url: /css static_dir: css My main.py file is as below: from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.ext.webapp import template class