Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Tornado Cookiecutter template

license build

This is my cookiecutter template to build a simple, fast and rock solid website based upon the Tornado framework. There are quite many Tornado templates out there, but I wanted to start something from scratch, that fits my needs and evolves out of years of experiences (positive and negative alike) with other Python based webframeworks like Turbogears and Django.

Of course this template is not designed for larger data structures. The main focus is on scalability, fast data access and small library dependencies.

1   Features

  • Configurable as a Cookiecutter template
  • Basic HTML5 Boilerplate
  • (Optional) pytest
  • (Optional) tox
  • (Optional) Docker support
  • (Optional) Vagrant support
  • (Optional) Internationalization (i18n) support

2   Usage

Install Cookiecutter

$ pip install cookiecutter

Initialize the project with cookiecutter and answer some questions for the newly started project:

$ cookiecutter

3   Template development

If you decide to contribute to this cookiecutter template, feel free to fork it and make a pull request. To start with the development of this template, you need to install some Python requirements:

[sudo] pip install poetry

After that simply let pipenv install all requirements:

$ poetry install

To activate the virtual environment, simply call:

$ poetry shell

Now you are able to run the tests for this template:

$ py.test

In addition to that you can install tox to test the template against different Python versions:

$ [sudo] pip install tox

And then run the tests with:

$ tox

4   Tornado project development

4.1   Testing

All tests will be added to the tests directory, whether you are using pytest for testing or other tools like nose- or unittests.

4.1.1   pytest

With pytest you will be able to run the tests with:

$ py.test

4.2   Running the application

To start the final application, just run the following fabric command:

$ fab devserver

This will tell Tornado to start the application with the default port 8888. If you want to use another port, just type:

$ fab devserver:port=8000

In addition to that, see the Script for other parameters and commands.

4.2.1   Vagrant

To run the server within a Vagrant VM, you need to install Vagrant 1.7.x and the Vagrant Alpine plugin:

$ vagrant plugin install vagrant-alpine

After that you can start the development server with the following command:

$ vagrant up
$ fab vagrant devserver

You can now access your application via http://localhost:8000

4.2.2   Docker

Install docker and docker compose in the latest version. Then start the tornado project with docker-compose:

$ docker-compose up

You can now access your application via http://localhost:8000