A skeleton for building Python applications on Google App Engine with Flask, React, Webpack and Babel.
-
Install the App Engine Python SDK. You'll need python 2.7 and pip 1.4 or later installed too.
-
Clone this repo with
git clone https://github.com/AxoSal/GAE-Flask-React-skeleton.git
-
Install Python dependencies in the project's lib directory and install Node dev dependencies. Note: App Engine can only import libraries from inside your project directory.
cd GAE-Flask-React-skeleton pip install -r requirements.txt -t lib npm install
-
Run
webpack --watch
from comand line so that you can
require
your components and compile .jsx files to .js. -
Run local server from the command line:
dev_appserver.py .
Visit the application http://localhost:8080
or
python main.py
And visit the application on http://localhost:5000
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> update app.yaml
-
Congratulations! Your application is now live at your-app-id.appspot.com
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.
Axo Sal