Google Blobstore use in app for Google App Engine - python

I'm trying to run a web app written in Python (using Flask) on Google App Engine in the python flexible environment (needs third party libraries not provided in standard environment).
The web app contains a simple form with the option to upload a file, which my app will then use to manipulate some data and serve up a new file as output. The app in its current state runs fine until a file exceeding 32 MB is uploaded.
According to this post - Upload file bigger than 40MB to Google App Engine? - the large file upload problem can be circumvented by using the Google Blobstore API.
An overview of the API is here: https://cloud.google.com/appengine/docs/python/blobstore/
I am having some trouble understanding this overview. In particular, my problem is simply being able to import the Blobstore API in my python code for the web app. In order to obtain a an upload URL, I have placed the following in my code:
from google.appengine.ext import blobstore
upload_url = blobstore.create_upload_url('/submit')
Finally, when I try to deploy the app using gcloud app deploy, it crashes with the message ImportError: No module named 'google'.
I don't understand how I can get this running. I thought the google appengine modules were already taken care of by the App Engine. Perhaps there is a line I can add to requirements.txt so that gcloud will install the proper libraries upon deployment?

Related

deploy first django test app to anywhere (azure or heroku)

tldr; - When I have deployed a flask app in the past, it uses a requirements.txt file in the main root of the project folder so that azure or heroku can understand what modules need to be installed. However, this is the first time I am messing with django. I am trying to test deploy to azure or heroku but I azure can't detect the stack of the app because there is no requirements.txt file in the main root of the folder.
From messing with django a little bit, it seems alot more complicated than flask. What can I do to test deploy the most basic app to azure app services or heroku or aws or any place in general?
I tried deploying the django app like I normally do with flask but received an error:
Could not auto-detect the runtime stack of your app.
HINT: Are you in the right folder?
For more information, see 'https://go.microsoft.com/fwlink/?linkid=2109470'
Here is a picture of what I am seeing on my side:
I would assume I am not in the right folder but I am not sure if that is the problem completely.
Here is app I am testing myself. Its a microsoft authenication test app where you can test your xbox live account, microsoft school account, or microsoft work account against the webpage: https://github.com/Azure-Samples/ms-identity-python-django-tutorial
**Of course I added the app registration information from azure. Infact, the same app registration information works on my flask app so any azure app registrations issues is probably not the issue. **
The repo you link contains multiple projects. It sounds like you need to clone this, then move one of the project sub-directories (which should have its own requirements.txt already) into a fresh working tree, initialize a new repo there, and then push that to the cloud provider.

Deploying an app that can upload, create new files, and download created files

I am currently working on creating a flask app that can take uploaded files(.xslx), use them for analysis, and then redirect to a page with the output and a download button to download the output that they see.
The local version I have right now just stores these files in ./uploads/. It then uses the uploaded file as input for some analysis. To do this analysis it uses another file stored in ./analysis/ and the results of this analysis are then stored in ./results/.
Currently, this flask app works but to deploy it, as far as I know, I can no longer use ./uploads/ and ./results/ nor can expect for there to be ./analysis/.
While I have worked on a few flask apps as projects, I have never really had to worry about deploying them (since I'm a student and have mainly worked on personal projects.)
What is the best way to deploy this app? I was going to use Heroku since that's the only deployment platform I've used in the past to deploy a full stack application and I'm completely lost on how to deploy this app.

Getting 'No such object' error when trying to download gcloud app engine builds

I have a Django application running on google app engine. Just because I don't know how to use Git, I usually download latest app engine version from google cloud build and work with different folder names. However this last week, when I try to download my google app engine project, I get this following error:
No such object: staging.project-id.appspot.com/eu.gcr.io/project-id/appengine/default.datetime:latest
I know I can get my files from cloud shell but I couldn't do it. Thats how I have found cloud builds after searching it for like a week.
Note: My Django app is still running.
A Cloud Storage bucket named staging.project-id.appspot.com was deleted or missing.
The Cloud Build files are stored in a Cloud Storage to serve as staging before being deployed to App Engine. You can try redeployment to re-create the said bucket.
Here's another option to download your App Engine code: Downloading Your Source Code

Python App Engine API to interact with Google Code Project Hosting

Referencing Manage Google Drive files through App Engine, I have kind of the same question about App Engine w.r.t. Google Code Project Hosting, i.e., is there a Python API to interact with the latter using the former. Thanks!
It's possible to programatically upload files to a Google Code project, see the script at:
https://code.google.com/p/support/wiki/ScriptedUploads
What else were you looking to automate?

Deleting files from google cloud storage through app engine?

I have developed an app using Flask and App Engine. I was able to upload file in google cloud storage, but not able to delete file.
I am using: files.delete('/gs/bucket/file.pdf') to delete a file.
App executes this line, but file is not deleted from cloud storage.
According to https://developers.google.com/appengine/docs/python/googlestorage/functions#delete, it should work.
It is not even working in local development server also.
Please let me know, what I am missing or is there any better to achieve this?

Categories

Resources