DjangoCMS on Aldryn/Docker

Collaboration through Aldryn

As Aldryn doesn’t have Github support, there are no PRs either. Collaboration is limited to:

Continuously export SASS/SCSS to CSS:

docker-compose run --rm web gulp watch --debug

Upload Changes to Aldryn Git

git pull
git add .
git commit -m "commit message"
git push

Apply changes from Aldryn Git

aldryn project update

or (quicker, if there are no changes to Aldryn settings):

git pull

Any migrations to apply?

docker-compose run --rm web python migrate

bring the project up again

aldryn project up


docker-compose up

Some Docker / Aldryn Tricks


Are you on Mac OS X? First of all, open the VirtualBox UI and release the docker machine from its pitiful state: Increase memory to 3GB and give it a second CPU (no need for additional GPU power though).


Whenever Aldryn complains that the docker-machine could not be found the solution is

eval $(docker-machine env default)


add this to your ~/.profile

# execute in the docker container
docker_manage() {
 eval $(docker-machine env default)
 docker-compose run --rm web python "$@"

# set env vars for the default docker machine (needed by all other docker / aldryn commands)
docker_env() {
 eval $(docker-machine env default)
alias denv=docker_env

# watch the aldryn-boilerplate-bootstrap3 sass into css
docker_watch() {
 eval $(docker-machine env default)
 docker-compose run --rm web gulp watch --debug
alias dwatch=docker_watch

# compile the aldryn-boilerplate-bootstrap3 sass into css
docker_build() {
 eval $(docker-machine env default)
 docker-compose run --rm web gulp build --debug
alias dbuild=docker_build

Some useful commands:

Rebuild the web container after adding a Django App:

docker-compose build web

Clean up old containers in batch:

docker ps -a | awk 'NR > 3 {print $1}' | xargs docker rm

Run docker containers on the command line (including log on the command line):

docker-compose up

Debug Aldryn Settings

docker-compose run --rm -e ALDRYN_ADDONS_DEBUG=True web python

This will give you a folder in


with the history of how settings are set by different Aldryn modules.

Create & install an Aldryn Addon on the local Aldryn setup

Here is the walkthrough:

DjangoCMS plugins & Django Apps with Aldryn

Understanding DjangoCMS Apps:

Understanding DjangoCMS apps in Aldryn:

How a messed up database situation can be recovered in Aldryn on OS X

When a django app migration did not work out the way it should have (for reasons that are beyond my understanding), I started to look into how to access the postgres database.

  1. Add this to your docker-compose.yml. This makes postgresql available on the docker machine’s IP address.
  - "5432:5432"

Then reload the containers

docker-compose restart

And use pgAdmin or similar to connect. Find your docker machine’s ip like this:

docker-machine ip