Coltrane

screenshot of Coltrane
django

Coltrane

A minimal app framework for content sites.

Overview

Coltrane is a Python package that allows users to render markdown files as HTML with automatic URL routing based on the filesystem. It also provides features such as using JSON files as data sources in HTML templates or markdown, automatic generation of sitemap.xml and rss.xml files, serving non-markdown files like robots.txt, and a local development server with live re-rendering of markdown and data. Coltrane follows deployment best practices with whitenoise and gunicorn already configured and can be integrated into a regular Django project as a standard third-party Django app.

Features

  • Render markdown files as HTML with automatic URL routing based on the filesystem
  • Use JSON files as data sources in HTML templates or markdown
  • Automatic generation of sitemap.xml and rss.xml files
  • Can serve non-markdown files like robots.txt
  • Local development server with live re-rendering of markdown and data
  • Deployment best practices with whitenoise and gunicorn already configured
  • Leverage the power of built-in Django templates, template tags, and filters inside markdown files
  • Any custom template tags and filters are enabled automatically for use in markdown or HTML templates
  • Able to be integrated into a regular Django project as a standard third-party Django app

Installation

  1. Create a new folder: mkdir new-site && cd new-site
  2. Initialize a new virtual environment and install the coltrane package:
    poetry init --no-interaction --dependency 'coltrane:<1' && poetry install
    
  3. Optional: Install watchman on MacOS for less resource-intensive local development server: brew install watchman
  4. Create the folder structure for a new site: poetry run coltrane create
  5. Start the local development server: poetry run coltrane play
  6. Access the rendered markdown in HTML by visiting http://localhost:8000
  7. Update markdown files in the content directory to see the changes reflected in the rendered HTML
  8. Optional: Build static HTML files by running poetry run coltrane record

Summary

Coltrane is a powerful Python package that allows users to render markdown files as HTML with automatic URL routing based on the filesystem. It offers features such as using JSON files as data sources, automatic generation of sitemap.xml and rss.xml files, serving non-markdown files, and a local development server with live re-rendering of markdown and data. Additionally, it follows deployment best practices and can be integrated into a regular Django project. With Coltrane, users can easily create and manage dynamic websites using markdown and HTML templates.

django
Django

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It follows the model-view-controller (MVC) architectural pattern, providing an extensive set of built-in tools and conventions to streamline the creation of robust and scalable web applications.