Install, configure, run

This project is open-source, published under BSD license. See License for details.

If you want to install a development environment, you should go to Contributing to diecutter documentation.

Prerequisites

Install

Install “diecutter” package with your favorite tool. As an example with pip [2]:

pip install diecutter

Configure

Use diecutter’s online demo [3] to generate your local diecutter configuration:

# Adapt "YOUR_TEMPLATE_DIR"!
wget -O diecutter.ini --post-data "template_dir=YOUR_TEMPLATE_DIR" http://diecutter.io/api/diecutter.ini

diecutter.service

Python path to service class that implements diecutter API. Default is diecutter.local.LocalService.

Builtin services are:

  • diecutter.local.LocalService
  • diecutter.github.GithubService

diecutter.engine

Code of the default engine to use to render files. Default is jinja2.

diecutter.filename_engine

Code of the default engine to use to render filenames. Default is filename.

diecutter.engine.*

Mapping between engine codes and Python path to the template engine class. Defaults:

  • django: piecutter.engines.django:DjangoEngine
  • filename: piecutter.engines.filename:FilenameEngine
  • jinja2: piecutter.engines.jinja:Jinja2Engine

Note

diecutter itself does not implement engines. Engines are implemented as part of piecutter.

Run

pserve (paster’s server) should have been installed automatically as part of diecutter’s dependencies. Use it to run the service:

pserve diecutter.ini --reload

Check

Check it works:

curl http://localhost:8106

You should get an “hello” with diecutter’s version.

References

[1]http://python.org
[2]https://pypi.python.org/pypi/pip/
[3]http://diecutter.io/