Installation

Note

uv and pip examples are shown below, although most standard Python package managers can be used to install coltrane.

  1. Install pipx

  2. pipx install uv to install uv globally

  3. mkdir new-site && cd new-site to create a new folder

  4. uv venv to create a Python virtual environment in .venv

  5. uv pip install "coltrane < 1" to install coltrane into the Python virtual environment

  1. mkdir new-site && cd new-site to create a new folder

  2. python3 -m venv .venv to create a Python virtual environment in .venv

  3. source .venv/bin/activate to activate the Python virtual environment

  4. pip install "coltrane < 1" to install coltrane into the Python virtual environment

Tip

brew install watchman on MacOS for a less resource-intensive local development server.

Extras

coltrane has some additional functionality that will be enabled if extra packages are installed.

  1. Add any extras between square brackets in the coltrane dependency in pyproject.toml, e.g. coltrane[deploy,json5,compressor] < 1

  2. uv pip install -r pyproject.toml

  1. pip install "coltrane[deploy,json5,compressor] < 1"

json5

Adds support for using JSON5 for data files. This allows trailing commas and comments in JSON, so it can be useful for making JSON a little more readable.

coltrane[json5]

django-compressor

Adds support for using django-compressor in templates.

coltrane[compressor]

Use the compress templatetag like normal (no need to load it in the template).

<head>
    {% compress css %}
    <link href="{% static 'css/styles.css' %}" rel="stylesheet" type="text/css">
    {% endcompress %}
</head>

Warning

Make sure to run python app.py compress after collectstatic when deploying the app so the compressed files get created as expected. See this Dockerfile for an example.

deploy

Adds support for deploying coltrane to a production server with gunicorn and whitenoise pre-configured. More details at deployment.md.

coltrane[deploy]