#######################
Install, configure, run
#######################

This project is open-source, published under BSD license.
See :doc:`/about/license` for details.

If you want to install a development environment, you should go to
:doc:`/contributing` documentation.


*************
Prerequisites
*************

* `Python`_ version 2.7.


*******
Install
*******

Install "diecutter" package with your favorite tool. As an example with `pip`_:

.. code-block:: sh

   pip install diecutter


*********
Configure
*********

Use `diecutter's online demo`_ to generate your local diecutter configuration:

.. code-block:: sh

   # 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 <https://piecutter.readthedocs.org>`_.


***
Run
***

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

.. code-block:: sh

   pserve diecutter.ini --reload


*****
Check
*****

Check it works:

.. code-block:: sh

   curl http://localhost:8106

You should get an "hello" with diecutter's version.


.. rubric:: References

.. target-notes::

.. _`Python`: http://python.org
.. _`pip`: https://pypi.python.org/pypi/pip/
.. _`diecutter's online demo`: http://diecutter.io/
