google-app-engine

Store images in datastore of GAE python while deploying web2py app

允我心安 提交于 2020-01-25 10:38:07
问题 I am trying to deploy a web2py application on GAE. When run locally, a phone_details table is defined in db.py using this line db.define_table('phone_details',Field('image',type='upload'),Field('name',unique=True),Field('screensiz'),Field('primcam'),Field('processor'),Field('ram'),Field('rom'),Field('os'),Field('company'),Field('price','integer')) To make it run on GAE, I created an entity in cloud datastore naming it 'phone_details' but there only string,boolean,number etc. are allowed

GAE - Getter without Setter - How to prevent client from writing a given property? How to prevent client from modifying the object ID?

折月煮酒 提交于 2020-01-25 10:37:06
问题 I am writing against Google App Engine using Java and Android Studio. Tools, Install Client Libraries creates a model for the frontend from backend classes. This works well. Now, I have realized that getters and setters are always generated for the client as part of the class model, or at least whenever I use a getter, a setter is auto-generated for the same property. I understand that REST needs to have getters and setters exposed to serialize and deserialize on both sides. But what happens

Google AppEngine Python Web upload file and read the content

本小妞迷上赌 提交于 2020-01-25 04:53:27
问题 I'm new at Python AND AppEngine, so maybe my question is basic but I've searched it for hours... So, I'm using Google AppEngine with python and HTML... So in my htlm file I have something like that : <form action="/sign?guestbook_name={{ guestbook_name }}" method="post"> <div><input type="file" name="file"></div> <div><textarea name="content" rows="3" cols="60"></textarea></div> <div><input type="submit" value="Sign Guestbook"></div> </form> and in my py file, something like that : class

Decoding international chars in AppEngine

倾然丶 夕夏残阳落幕 提交于 2020-01-25 04:00:06
问题 I'm making a small project in Google AppEngine but I'm having problems with international chars. My program takes data from the user through the url "page.html?data1&data2..." and stores it for displaying later. But when the user are using some international characters like åäö it gets coded as %F4, %F5 and %F6. I assume it is because only the first 128(?) chars in ASCII table are allowed in http-requests. Is there anyone who has a good solution for this? Any simple way to decode the text?

Are these limitations still there when using JPA with Cloud SQL?

徘徊边缘 提交于 2020-01-25 01:59:30
问题 I doubt it but still want to confirm if these limitations are still there or not when using JPA with Cloud SQL. Unsupported Features of JPA 1.0 The following features of the JPA interface are not supported by the App Engine implementation: Owned many-to-many relationships, and unowned relationships. You can implement unowned relationships using explicit Key values, though type checking is not enforced in the API. "Join" queries. You cannot use a field of a child entity in a filter when

taskqueue and non-idempotent tasks

百般思念 提交于 2020-01-25 00:59:06
问题 I'm working on a voting app, where the user can upload a list of email addresses for all of the voters. After doing some error checking, I create a Voter entity for each voter. Since there can be a large number of voters, I create the Voter entities in a taskqueue to avoid the 30 second limit and the task looks like this: put_list = [] for email, id in itertools.izip(voter_emails, uuids): put_list.append(Voter(election = election, email = email, uuid = id)) election.txt_voters = "" put_list

How to loop over histogram to get the color of the picture?

倾然丶 夕夏残阳落幕 提交于 2020-01-25 00:53:33
问题 In this answer about detecting the color of an image olooney said that "loop over the histogram and take the average of pixel color weighed by the pixel count". I ran the histogram like this: class ImageResize(webapp.RequestHandler): def get(self): q = HomePage.all() q.filter("firm_name", "noise") qTable = q.get() id = qTable.key().id() if id: homepage = HomePage.get_by_id(id) if homepage: img = images.Image(homepage.thumbnail) hist = img.histogram() then in IDLE, for each color of the

Google Cloud Endpoint API returns 500 error

扶醉桌前 提交于 2020-01-25 00:35:06
问题 I applied the answer found in HTTP code 302 encountered when deploying on Google App Engine Endpoints The 302 problem is gone, the API has become visible in the deployed application, but now I'm getting this error: { "error": { "errors": [ { "domain": "global", "reason": "internalError", "message": "Internal Error" } ], "code": 500, "message": "Internal Error" } } The application log shows the 200 response for this request though: 2013-03-07 18:57:10.992 /_ah/spi/DeviceSyncEndPoint

Cloud Debugger with Google app Engine

情到浓时终转凉″ 提交于 2020-01-25 00:13:09
问题 On which version does the cloud debugger takes snapshot. Is it from default version? if yes, how can I make it takes snapshot of some other version. this page doesn't talks about versions. 回答1: Right -- Currently the debugger only works on the default version of the app engine app. You need to have the source code for that version of your app in the default branch of the git repo. 回答2: If you have multiple versions (or modules) of the app deployed at the same time, the debugger UI (Google

Cloud Container Builder, ZIP does not support timestamps before 1980

∥☆過路亽.° 提交于 2020-01-24 22:05:50
问题 I'm trying the following tutorial. Automatic serverless deployments with Cloud Source Repositories and Container Builder But I got the error below. $ gcloud container builds submit --config deploy.yaml . BUILD Already have image (with digest): gcr.io/cloud-builders/gcloud ERROR: (gcloud.beta.functions.deploy) Error creating a ZIP archive with the source code for directory .: ZIP does not support timestamps before 1980 ERROR ERROR: build step 0 "gcr.io/cloud-builders/gcloud" failed: exit