Installation¶
Note
uv and pip examples are shown below, although most standard Python package managers can be used to install coltrane.
pipx install uvto installuvgloballymkdir new-site && cd new-siteto create a new folderuv venvto create a Python virtual environment in.venvuv pip install "coltrane < 1"to installcoltraneinto the Python virtual environment
mkdir new-site && cd new-siteto create a new folderpython3 -m venv .venvto create a Python virtual environment in.venvsource .venv/bin/activateto activate the Python virtual environmentpip install "coltrane < 1"to installcoltraneinto 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
coltranedependency inpyproject.toml, e.g.coltrane[deploy,json5,compressor] < 1uv 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]