A skeleton for building Python applications on Google App Engine with the Flask micro framework.
See our other Google Cloud Platform github repos for sample applications and scaffolding for other python frameworks and use cases.
-
Install the App Engine Python SDK. See the README file for directions. You'll need python 2.7 (appengine can crash in windows with python 2.7+, please install phyton 2.7.9) and pip 1.4 or later installed too.
-
Clone this repo with
git clone https://github.com/Eforcers/python-gae-template.git
-
Install dependencies in the project's lib directory. Note: App Engine can only import libraries from inside your project directory.
cd python-gae-template pip install -r requirements.txt -t lib
Is necesary to add the next code fragment in /lib/pipeline/util.py
over definition of
version = os.environ["CURRENT_VERSION_ID"].split(".")[0] module = os.environ["CURRENT_MODULE_ID"]
in method _get_task_target():
the code is:
if os.environ['SERVER_SOFTWARE'].startswith('Dev'): return module
-
Install bower dependencies in static/components. Note: before install node and bower. in folder
bower install
-
IMPORTANT: in lib/piplines/util.py:66, after of ( module = os.environ["CURRENT_MODULE_ID"]) paste:
if os.environ['SERVER_SOFTWARE'].startswith('Dev'): return module
-
Run this project locally from the command line:
dev_appserver.py .
Visit the application http://localhost:8080
See the development server documentation for options when running dev_appserver.
To deploy the application:
-
Use the Admin Console to create a project/app id. (App id and project id are identical)
-
appcfg.py -A <your-project-id> --oauth2 update .
-
Congratulations! Your application is now live at your-app-id.appspot.com
This skeleton includes TODO
markers to help you find basic areas you will want
to customize.
To add persistence to your models, use NDB for scale. Consider CloudSQL if you need a relational database.
See the Third party libraries page for libraries that are already included in the SDK. To include SDK libraries, add them in your app.yaml file. Other than libraries included in the SDK, only pure python libraries may be added to an App Engine project.
Star this repo if you found it useful. Use the github issue tracker to give feedback on this repo.
See CONTRIB.md
See LICENSE
Logan Henriquez and Johan Euphrosine