Environment

For local web development coltrane uses an .env file in the base directory for potentially sensitive settings. When deployed to production, those settings would be retrieved from environment variables (following the 12-factor app method).

Example .env file

DEBUG=True
INTERNAL_IPS=127.0.0.1
ALLOWED_HOSTS=example.com
COLTRANE_SITE_URL=https://example.com
SECRET_KEY=this-should-be-lots-of-random-characters

Keys

DEBUG

Whether the server is in debug mode or not. Error tracebacks, context, and sensitive information is displayed on the error page when this is set to True, so it should always be set to False when the app is deployed to production. Defaults to True for local development purposes.

INTERNAL_IPS

Used to determine if the current request is internal or not. Must be set for the debug template variable to be populated (more information in the Django documentation). Defaults to 127.0.0.1. If more than one IP is required, separate them by commas.

INTERNAL_IPS=127.0.0.1,localhost,192.168.0.1

SECRET_KEY

A random string of letters, numbers, and characters. (More information in the Django documentation. Generated automatically when the .env file is created. Required.

ALLOWED_HOSTS

The acceptable host or domain names when the site is deployed to production. Required when DEBUG is set to False. Defaults to "". If more than one host name is required, separate them by commas.

ALLOWED_HOSTS=coltrane.com

COLTRANE_SITE_URL

The hosting domain’s scheme and domain. Required.

COLTRANE_SITE_URL=https://coltrane.com

COLTRANE_TITLE

The title of the website. Required for generating rss.xml.

COLTRANE_TITLE=Coltrane

COLTRANE_DESCRIPTION

The description of the website. Required for generating rss.xml.

COLTRANE_DESCRIPTION=A minimal app framework for content sites.

COLTRANE_IS_SECURE

Informs coltrane that it is served securely, i.e. with SSL with an https protocol. This needs to be set to True if SSL is provided by a proxy server (for example, Cloudflare). If the site is only served by https and you see errors like “403 forbidden CSRF origin didn’t match” set this to True. Defaults to False.

COLTRANE_CONTENT_DIRECTORY

The directory that should be used for markdown content. Relative to the base directory. Defaults to “content”.

COLTRANE_DATA_DIRECTORY

The directory that should be used for data. Relative to the base directory. Defaults to “data”.

COLTRANE_DATA_JSON5

Whether or not data files should be parsed as JSON5. Also requires installing with the json5 extras (e.g. poetry add coltrane -E json5 or pip install coltrane[json5]). Defaults to False.

COLTRANE_DISABLE_WILDCARD_TEMPLATES

To prevent wildcard templates from being served, set this to True. Defaults to False.

CACHE

The type of cache to use for coltrane. Acceptable options are: dummy, memory, filesystem, memcache, or redis. The default is dummy.

Note

filesystem, memcache, and redis options require CACHE_LOCATION to also be set.

CACHE_LOCATION

The location of the cache. Required for filesystem, memcache, and redis cache options. The filesystem cache requires an absolute path. The memcache and redis cache options include multiple cache servers in a commma-delimited list.

TIME_ZONE

The timezone of the server. Defaults to “UTC”.