Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A static site generator

Project Description


Discharge is a static site builder implemented in python. It builds static sites from a folder full of Jinja2 templates, Markdown files, and other assets (js, css, images etc.). It uses pygments for syntax highlighting of <code> blocks

It is heavily plugin based - most of the functionality comes from plugins shipped with discharge.

It is currently alpha software and subject to backwards-incompatible changes.


Use your favorite install method, for example:

$ pip install discharge


Create a file in your source directory called (files starting with a _ or a . are ignored by discharge):

import os

from import Site

site = Site(
    os.path.join(os.path.dirname(__file__), './'),
    os.path.join(os.path.dirname(__file__), '_build'),

from discharge.plugins.robots import RobotsPlugin
robots_plugin = RobotsPlugin()

from discharge.plugins.jinja2_templates import Jinja2TemplatesPlugin
jinja2_templates_plugin = Jinja2TemplatesPlugin()

from discharge.plugins.markdown import MarkdownPlugin
markdown_plugin = MarkdownPlugin()

Create .html, .markdown and .mdown files in the same folder and they will be processed by Jinja2 or Markdown.

Markdown files will be rendered using a template _page.html which you must provide yourself. You can use {{content}} in _page.html to get the content produced by Markdown.

You can then run discharge build to build the site or dscharge serve to run the development server.

Release History

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Discharge-0.3.0.tar.gz (6.8 kB) Copy SHA256 Checksum SHA256 Source Oct 4, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting