Python Makefile Batchfile Ruby HTML Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Tornado Cookiecutter template

Build Status

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.


  • Configurable as a Cookiecutter template
  • Basic HTML5 Boilerplate
  • (Optional) pytest
  • (Optional) tox
  • (Optional) Bumpversion for updating version information
  • (Optional) Docker support
  • (Optional) Vagrant support


Install Cookiecutter:

$ pip install cookiecutter

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

$ cookiecutter

project_name [project_name]: tornado_test
project_slug [tornado_test]:
author_name [Your name]: Your name
email [Your e-mail]:
github_username [yourname]: yourusername
repo_name [tornado-project]:
description [A short description of the project.]: This is my Tornado project
version [0.1.0]:
use_pytest [y]: y
use_tox [y]: y
use_docker [y]: y
use_vagrant [y]: y
use_bumpversion [y]: y
Select open_source_license:
1 - MIT license
2 - BSD license
3 - ISC license
4 - Apache Software License 2.0
5 - GNU General Public License v3
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]: 1



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


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

$ py.test

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.


To run the server within a Vagrant VM, you need to install Vagrant 1.7.x and start the development server with the following command:

$ vagrant up
$ fab vagrant devserver

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


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