README.markdown

django-medusa

Note: This project is largely unmaintained since 2014 and may be broken. If you
want to use something similar that's gotten more love lately, look at the following
which are still somewhat active, as of January 2016:

django-medusa allows rendering a Django-powered website into a static website a la Jekyll,
Movable Type, or other static page generation CMSes or frameworks.
It is designed to be as simple as possible and allow the
easy(ish) conversion of existing dynamic Django-powered websites -- nearly any
existing Django site installation (not relying on highly-dynamic content) can
be converted into a static generator which mirror's that site's output.

Given a "renderer" that defines a set of URLs (see below), this uses Django's
built-in TestClient to render out those views to either disk, Amazon S3,
or to Google App Engine.

At the moment, this likely does not scale to extremely large websites due to
the use of the internal TestClient. But django-medusa optionally uses the
multiprocessing library to speed up the rendering process by rendering many
views in parallel.

For those uninterested in the nitty-gritty, there are tutorials/examples
in the docs dir:

Be aware that the S3 renderer will overwrite any existing files that match
URL paths in your site.

The S3 backend will force "index.html" to be the Default Root Object for each
directory, so that "/about/" would actually be uploaded as "/about/index.html",
but properly loaded by the browser at the "/about/" URL.

BONUS: Additionally, the S3 renderer keeps the "Content-Type" HTTP header
that the view returns: if "/foo/json/" returns a JSON file (application/json),
the file will be uploaded to "/foo/json/index.html" but will be served as
application/json in the browser -- and will be accessible from "/foo/json/".

This generates a app.yaml file and a deploy directory in your
MEDUSA_DEPLOY_DIR. The app.yaml file contains the URL mappings to upload
the entire site as a static files.

App Engine generally follows filename extensions as the mimetype. If you have
paths that don't have an extension and are not HTML files (i.e.
"/foo/json/", "/feeds/blog/", etc.), the mimetype from the "Content-Type" HTTP
header will be manually defined for this URL in the app.yaml path.