Useful shell commands

This document describes a few useful shell commands. For more Docker commands, see More about Docker.

Opening a shell

Using Docker

Open a shell on an already running container (e.g. via docker-compose up):

$ docker-compose exec django

Or open a shell on a new container, and remove it on exit:

$ docker-compose run --rm django

Without Docker

Or open a shell without Docker from the GLAMkit project template (or a GLAMkit project) directory:

$ cd project_template
$ ./

you can get a shell and skip the Django operations with:

$ ./ bash

Once in a shell

Run Django management commands:

$ migrate --list
$ shell_plus

Install a Python package:

$ pip install -U django-icekit
$ pip install -e git+

Open a PostgreSQL shell:

$ psql

Dump the database:

$ pg_dump -O -x -f dump.sql

Run the tests:


Run a single test:


Manage Supervisord programs (Gunicorn, Nginx, etc.):

$ status
$ restart gunicorn

Display a list of other frequently used shell commands: