Deploy webapp on GAE then do changes online from GAE console - python

I deployed a webapp2 python application on GAE. Is there any way with which i can explore the source code or make changes in the project files from GAE console. Is it possible that if i only want to update a single .py file on already deployed app rather than again deploying the whole project?

I think you're looking for this :
https://console.cloud.google.com/code/develop
I pushed my code on Google Cloud Platform with git, and I'm able to change text files directly online.
The doc is here :
https://cloud.google.com/source-repositories/

Related

Deploying Flask application on Google App Engine

This is my first web app I've ever developed, so even though I thoroughly searched everything I could for the Google App Engine, I'm afraid that my terminology and Google fu simply isn't good enough for what I need.
When I open up my terminal and type "python main.py", I can see that it works correctly on localhost.
Now I am trying to host this application on the Google App Engine. I have spent hours watching Youtube tutorials and following setup guides, trying to emulate their file structure and file contents. Whenever I deploy my app, I get the "500- Server Error: The server encountered an error and could not complete your request."
Here is my code: https://github.com/csherrod5/csherrod5.github.io
Here is an example of the types of guides I've been following: https://medium.freecodecamp.org/how-to-build-a-web-app-using-pythons-flask-and-google-app-engine-52b1bb82b221
I'm hoping someone is kind enough to help me diagnose my problem.
Thank you to everyone who stops by
There's no lib folder in your application directory, so App Engine won't have any of the third party libraries you're trying to import.
You've correctly added the appengine_config.py file needed to vendorise third-party libraries, but you need to add the libraries you want to use to a 'lib' folder in your application directory.
Some of the libraries you want to use are built into the runtime, you just have to add them to your app.yaml to use them.

How can I edit the NGINX configuration on Google App Engine flexible environment?

How can I edit the Google App Engine NGINX configuration?
There doesn't seem to be much support in the Google docs in regards to the NGINX configuration for apps running in the Google App Engine flexible environment.
My app is running fine, but I get this 413 error when I try and upload an audio file (.wav or .mp3).
413 Request Entity Too Large -- nginx
My app is running Django (python 3), with Cloud Postgres SQL and Cloud Storage enabled.
I researched the error, and it seems I can set a nginx.config file so that it includes "client_max_body_size 80M" - but like I said, there is no documentation regarding how to manually config NGINX on deploy.
Any suggestions?
You should be able to create a nginx-app.conf file in the same directory as your app.yaml file. There is an example of using the nginx configuration file in a Flex environment located here: https://github.com/GoogleCloudPlatform/getting-started-php/tree/master/4-auth .
This same file is referenced in Google's documentation here: https://cloud.google.com/appengine/docs/flexible/php/runtime#customizing_nginx
Once you have that file created, you should be able to add any property you need and then rebuild your project to see the changes take effect.
So upon contacting Google Support, the suggested solution for uploading files larger than 32MB is as follows:
"The way to circumvent App Engine's 32MB limit is to send the requests directly to Cloud Storage, for instance using the resumable upload process. You can still use App Engine to serve your app, but the clientside portion of the app would be the one handling the upload to Google Cloud Storage. For this you would have your application generate a signed URL which the client can use to gain access to your Cloud Storage bucket for the purpose of uploading an image."
I went with this solution. It saves money in the end.

App directory doesn't show up on google cloud shell

Probably a stupid question.
I'm new to google app engine. So I followed the tutorial and successfully deployed their HelloWorld app, where the final steps are done on the cloud shell.
Then I built my own app in flask on my local machine, tested it (pushed the repo to the project's cloud repo) and deployed it from the command line (gcloud app deploy) and it works fine, anyone can use the app on their browser and I can also see the source code in the console website.
But I don't see any directories when I use the cloud shell. I get the prompt username#project-id:~$ but when I ls, there's just one README file and no other directories, therefore I can't use the devapp_sever.py, gcloud app deploy or any other shell function on this project.
But when I choose the hello world project that was created initially, the shell shows an src directory which contains the app's code and I can use the shell and deploy the app from there.
What's happening here and what am I supposed to do.?
Think of your Cloud Shell as just another workstation with local disk similar to your local machine. To deploy code to an app engine app, Google will create a Cloud Source Repository. Having said that, this is not related to your Cloud Shell. You can of course git clone any Git repo into your Cloud Shell.
Dan also wrote a nice explanation here -
https://stackoverflow.com/a/42123320/7947020
Hope this clarifies it!

Accessing Google Groups Services on Google Apps Script in Google App Engine?

I'm trying to work out if it is possible to use Google Apps Scripts inside Google App Engine?
And if there is a tutorial in doing this out there ?
Through reading Google's App Script site I get the feeling that you can only use app scripts inside Google Apps like Drive, Docs etc?
What I would like to do is to be able to use the Groups Service that is in GAS inside GAE to Create, delete and only show the groups that a person is in, all inside my GAE App.
Thanks
No you can't. AS and GAE are totally different things and won't work together.
What you can really do is (abstract):
write an AS that does what you need
redirect from GAE to the AS url to make sure that the user logs-in/grants permissions.
perform what you needed to do with AS
send back the user to GAE with a bunch of parameters if you need to
If you need GAE in Google Apps script, you can write a webservice in GAE using UrlFetch in Apps Script: https://developers.google.com/apps-script/service_urlfetch
To give you an example: I created an Apps Script to get report data (json) from an appengine webservice. This data is added to a google apps spreadsheet.

How do I use the Python SDK for Google Appengine?

I normally use Java development and the Google Eclipse plugin, which integrates GoogleAppEngine deploy capability.
Now I have found a Python application with source code that I want to bring into Eclipse and deploy from Eclipse, but I don't even know if Eclipse supports Python.
What do I have to do to deploy the Python app to GAE ?
Download PyDev from its Eclipse update site.
Create a new PyDev Google App Engine Project, say using the 'Hello webapp world' template.
Set the application in app.yaml to your GAE application ID.
Right-click the src folder of your project and select Run As | PyDev:Google App Run.
Test the application works as expected in your browser.
Right-click the src folder of your project and select PyDev:Google App Engine | Upload. Follow the prompts.
Check that it works on your GAE site.
Replace the hello webapp world code with your actual application's code and retest locally, then upload again and test.
Take a look at Pydev - http://pydev.org/
I haven't used python via Eclipse at all so I'm not sure how things map to the way Eclipse deploys, but generally to deploy all you need to do is this from the command line:
appcfg.py update <app directory>
You can find more help about using Python with appengine here:
http://code.google.com/appengine/docs/python/gettingstarted/

Categories