diecutter: templates as a service

This is a draft for diecutter poster session at EuroPython 2013, Florence.

Here is the poster: poster.pdf.

Render files & directories

Generate configuration

curl -X POST \
     -d ssl=on \
     -d domain=example.com \
     https://diecutter/nginx/ \
     | tar -zxv --directory=/etc/nginx/
curl -X POST \
     --data-binary '@nginx.ini' \
     -H "Content-Type: text/plain" \
     https://diecutter/nginx/sites-available/front \
     > /etc/nginx/sites-available/front
  • Easy to automate
  • POST context data in file
  • Pick a single file in directory
  • Need to see the diff? Use mercurial or git!

Generate code

Run:

curl -X POST  \
     -d django_project=demo  \
     -H accept:application/zip \
     http://diecutter.alwaysdata.net/api/+django_project+/

You get:

.
├── demo/
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
└── manage.py

Run:

firefox http://diecutter.alwaysdata.net/sphinx-docs.html

You get:

docs/
├── conf.py
├── demo.txt
├── index.txt
└── Makefile
  • All you need is an HTTP client
  • Use community templates or your own
  • Dynamic filenames
  • Dynamic trees
  • Online HTML client => user-friendly form

Adapt

Multiple template engines

  • Jinja
  • Cheetah
  • Mako
  • XML+XSLT
  • ERB...

Templates anywhere

  • Local files
  • Online code repositories
  • URL

KISS

Authentication, data validation, client... can be setup by combination with other tools (frontends, wsgi...)

Easy to deploy

  • Ready to use SAAS platform
  • Simple setup of private or local servers
  • Open source

REST API

  • GET, PUT, DELETE templates
  • POST data
  • Display OPTIONS, PATCH defaults

Built as a framework

  • Consistent defaults
  • Fully configurable
  • Extensible

Credits, license

https://diecutter.readthedocs.org

diecutter is licensed under BSD

  1. 2012-2013, Benoît Bryon & Rémy Hubscher