Installation¶
Note
uv
and pip
examples are shown below, although most standard Python package managers can be used to install coltrane
.
pipx install uv
to installuv
globallymkdir new-site && cd new-site
to create a new folderuv venv
to create a Python virtual environment in.venv
uv pip install "coltrane < 1"
to installcoltrane
into the Python virtual environment
mkdir new-site && cd new-site
to create a new folderpython3 -m venv .venv
to create a Python virtual environment in.venv
source .venv/bin/activate
to activate the Python virtual environmentpip install "coltrane < 1"
to installcoltrane
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.
Add any extras between square brackets in the
coltrane
dependency inpyproject.toml
, e.g.coltrane[deploy,json5,compressor] < 1
uv pip install -r pyproject.toml
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]