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 ...
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.
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.
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.
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.
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
.
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.
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
.
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