Home

Awesome

Support me with a Follow

connect-love demo App

Here's the code for https://connect-love.appspot.com/, a basic GAE app using Django and React.

alt text

Following the steps in Google App Engine + Django and iterating on the commenting tool covered in my Django + React tutorial, here's an end-to-end outline to deploy a React App on Google App Engine (GAE) with Django backend.
WHY the combo?

Steps to set up the tool.

Setup virtualenv (optional)

virtualenv ve
. ve/bin/activate

Install dependencies

# Installs all JS dependencies.
npm install
# Install python dependencies needed in runtime under lib/.
pip install -r requirements-vendor.txt -t lib/
# Install other python dependencies not needed by App Enginge regularly.
pip install -r requirements-local.txt

Run continuous webpack compiler to get static JS, CSS files.

./node_modules/.bin/webpack --config webpack.config.js --watch

Create django db table (first follow steps from GAE tutorial to first create Cloud SQL database).

./manage.py makemigrations comment
./manage.py migrate

Run django server for development.

./manage.py runserver

After iteration is done, run local server through app.yaml to make sure that all directory is correctly linked for GAE.

# dev_appserver is installed through GAE SDK.
dev_appserver app.yaml

Deploy when you are ready (and have registered a GAE project).

# First collect all static files, which is set to be dumped to dist/ in settings.py
./manage.py collectstatic
# Deploy like a boss, and appcfg.py is also installed through GAE SDK.
appcfg.py -A [project-id] update app.yaml