Skip to main content

A simple content site framework that harnesses the power of Django without the hassle.

Project description

coltrane

A simple content site framework that harnesses the power of Django without the hassle 🎵

PyPI PyPI - Downloads GitHub Sponsors

📖 Complete documentation: https://coltrane.readthedocs.io

📦 Package located at https://pypi.org/project/coltrane-web/

⭐ Features

  • Can either generate a static HTML, be used as a standalone Django site, or integrated into an existing Django site
  • Write content in markdown and render it in HTML
  • Use data from JSON files in templates and content
  • Live re-rendering of markdown and data when files are saved with the magic of https://github.com/adamchainz/django-browser-reload
  • All the power of Django templates, template tags, and filters inside markdown files
  • Can include other Django apps for additional functionality
  • Opinionated Django project setup where everything works "out of the box"

⚡ Quick start for a new static site

  1. mkdir new-site && cd new-site to create a new folder
  2. poetry init --no-interaction --dependency 'coltrane-web:<1' && poetry install to create a new virtual environment and install the coltrane package
  3. poetry run coltrane create to create the folder structure for a new site
  4. Update content/index.md
  5. poetry run coltrane play for a local development server
  6. Go to http://localhost:8000 to see the updated markdown rendered into HTML
  7. poetry run coltrane record to output the rendered HTML files

Optional

  • Enable watchman for less resource-intensive autoreload on MacOS: brew install watchman

How to add new content

Add markdown files or sub-directories with markdown files to the content directory and they will automatically have routes created that can be requested.

Example markdown files

content/index.md
content/about.md
content/articles/this-is-the-first-article.md

poetry run coltrane play will enable these URLs

  • http://localhost:8000/ which serves HTML generated from the /content/index.md file
  • http://localhost:8000/about/ which serves HTML generated from the /content/about.md file
  • http://localhost:8000/articles/this-is-the-first-article/ which serves HTML generated from the /content/articles/this-is-the-first-article.md file
  • http://localhost:8000/not-there/ will 404

poetry run coltrane record will create these HTML files

  • output/index.html
  • output/about/index.html
  • output/articles/this-is-the-first-article/index.html

Read all of the documentation at https://coltrane.readthedocs.io.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coltrane-web-0.12.0.tar.gz (16.4 kB view hashes)

Uploaded Source

Built Distribution

coltrane_web-0.12.0-py3-none-any.whl (18.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page