[PYTHON] Until you run a Flask application on Google App Engine for the time being

Instructions for running Flask applications on GAE. To be honest, I've just started studying, so I may be fooling myself, so please point out ...

What is Google App Engine?

According to Wikipedia

Google App Engine (GAE) is one of the services provided by Google, which develops web applications using PHP, Python, Java, and Go languages, runs them on Google's infrastructure, and manages versions. be able to. Part of Google Cloud Platform.

And that. I'm not sure, but it's a very easy server.

What is Flask

Flask is a Python web framework. Unlike django, it seems to be called microframework because it has only the minimum necessary functions. Perfect when you want to develop a web application a little. For more information, please see Konohen.

Until you move it with GAE for the time being

usage environment

The environment used is Ubuntu 14.04, Python 2.7.6. By the way, Ubuntu used the one running on Conoha's VPS this time.

I think that the method described here can be used with other Linux, but Python requires 2.7.x.

1. Drop the SDK

Drop the SDK for Python from Google. Link to here.

Copy the link for google_appengine_1.9.38.zip (at the time of writing) on Linux / Other Platforms

wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.38.zip

I think I should do it. Unzip the dropped zip around unzip and move it to any directory.

2. Pass through Path

It will be easier later if you put the path in the directory of google_appengine that was dropped and expanded in 1. Give it a vim ~ / .bash_profile

export PATH=$PATH:/usr/local/bin/google_appengine

After writing and saving it, you can use sorce ~ / .bash_profile.

3. Clone the test project

You can write it yourself, but this time the goal is to move it, so let's clone a sample from Google Cloud Platform Github. If you don't have git, please have git installed.

git clone https://github.com/GoogleCloudPlatform/appengine-flask-skeleton.git

I think you can drop it with.

4. Execute

The test server is dev_appserver.py in the SDK, so if you want to run it

dev_appserver.py /path/to/project

It will be like. (Note that path / to / project is the path to the project directory, not main.py.)

By the way, if you are running on VPS, you can not see it from the browser with the above command.

dev_appserver.py --host 0.0.0.0 /path/to/project

Then try accessing http://example.com:8080.

When an error occurs

Maybe you don't have enough libraries. In that case,

pip install -r requirements.txt -t lib

I think you should give it as and then execute it.

Recommended Posts

Until you run a Flask application on Google App Engine for the time being
[Python] Run Flask on Google App Engine
Run yolov4 "for the time being" on windows
Deploy a Django application on Google App Engine (Python3)
Until you can install blender and run it with python for the time being
Do you have any recommendations for a commentary book on Google App Engine / Python development?
Publish the site for free on Google App Engine (personal memorandum)
Until you deploy a SpringBoot project in Gradle on App Engine Flexible
Make a histogram for the time being (matplotlib)
Tweet (API 1.1) on Google App Engine for Python
Until you install Python with pythonbrew and run Flask on a WSGI server
Run the flask app on Cloud9 and Apache Httpd
Run with CentOS7 + Apache2.4 + Python3.6 for the time being
PIL with Python on Windows 8 (for Google App Engine)
I tried running PIFuHD on Windows for the time being
I want to create a Dockerfile for the time being.
Run the app with Flask + Heroku
Deploy the Flask app on Heroku
Use ndb.tasklet on Google App Engine
Building a development environment with Maven on Google App Engine [Java]
Deploy the Flask app on heroku
If you are a beginner in programming, why not make a "game" for the time being? The story
Randomly play the movie on ChromeCast for a certain period of time
Deploy a Python app on Google App Engine and integrate it with GitHub
I measured the run queue wait time of a process on Linux
Until you publish (deploy) a web application made with bottle on Heroku
Python Master RTA for the time being
Use external modules on Google App Engine
Until you win the silver medal (top 3%) in the competition you participated in within a month for the first time in data science!
Check when the HTML obtained by Requests on Google App Engine is garbled
Until you install Caffe and run the sample
For the time being, import them into jupyter
Use logger with Python for the time being
I played with Floydhub for the time being
Until you run the changefinder sample in python
Until you can use the Google Speech API
Try using LINE Notify for the time being
A memorandum for touching python Flask on heroku
(For myself) AWS_Flask_3 (Install / Run Flask on AWS)
Until you create a new app in Django
virtualenv For the time being, this is all!
Until you install Anaconda for data analysis on your Mac and launch the IDE
Until you create a machine learning environment with Python on Windows 7 and run it
"Stop committing Japanese files to git on Mac> <" For the time being, I wrote a script to search for incompatible Japanese files on Mac and Linux.
Until the web application is released on Sakura VPS
I tried Python on Mac for the first time.
Flow memo to move LOCUST for the time being
Register a task in cron for the first time
Create a QR code for the URL on Linux
Molecular dynamics simulation to try for the time being
I tried python on heroku for the first time
Until you install Gauge and run the official sample
(Beginner) Basic usage of Datastore on Google App Engine
Getting Started with Google App Engine for Python & PHP
I will install Arch Linux for the time being.
Next to Excel, for the time being, jupyter notebook
How to use Django on Google App Engine / Python
I want to use the Ubuntu desktop environment on Android for the time being (Termux version)
I want to use Ubuntu's desktop environment on Android for the time being (UserLAnd version)