Wagtail is an interesting Django-based CMS that for the most parts runs out of the box on Google App Engine.

First of all, Google already has nice tutorial with corresponding code on how to host Django sample polls app on App Engine. I built my own example based on that tutorial and here's what it takes to install Wagtail on Ubuntu 14.04 LTS.

From all cloud providers Google has the most generous trial offer - $300 worth of services, assuming that you have GCP account, install SDK

curl https://sdk.cloud.google.com | bash  

initialize it with gcloud init and then install App Engine components:

gcloud components install app-engine-python  

Download example app:

sudo apt-get update  
git clone https://github.com/bashtavenko/wagtail-on-gae-example.git  

Then we need to setup Cloud SQL and proxy, just like it's described in tutorial since we need to run migrations directly in Cloud SQL. Then we need to update host name in password in mysite/settings/base.py, create blog database - create database blog;. Then we can migration (initialize database table based on models):

.\manage.py migrate
.\manage.py createsuperuser

If everything worked, we can run app locally:

.\manage.py runserver

and deploy it to App Engine

./manage.py collectstatic
gcloud app deploy  

So, it's fairly straightforward and the only hiccup along this way was with Pillow image library for which I installed these components:

sudo apt-get install python-dev python-setuptools  
sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev  
sudo apt-get install libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk  

and then we need a couple lines in app.yaml since Wagtail requires specific PIL version as it was described in this helpful post:

libraries:  
  name: PIL                                                       
  version: "1.1.7" 
# ....
skip_files:  
  ^(lib/PIL*)

This bare-bone app leaves several questions:

  • Where should blog images and other artificts be stored
  • What about authentication
  • Can GCP Datastore be used instead of Cloud SQL
  • And more...

All of those questions can be solved in just one open-source library..