Fetching contributors…
Cannot retrieve contributors at this time
129 lines (91 sloc) 4.21 KB

Honcho: manage Procfile-based applications

Welcome! This is the home of Honcho and its documentation. Honcho is:

  1. A Python port of David Dollar's Foreman: a command-line application which helps you manage and run Procfile-based applications. It helps you simplify deployment and configuration of your applications in both development and production environments.
  2. Secondarily, Honcho is a Python library/API for running multiple external processes and multiplexing their output.

The current version of Honcho is |release| and it can be downloaded from GitHub or installed using pip: see :ref:`installing_honcho`.

Documentation index

What are Procfiles?

A Procfile is a file which describes how to run your application. If you need to run a simple web application, you might have a Procfile that looks like this:

web: python

You'd then be able to run your application using the following command:

$ honcho start

Now, if running your application is as simple as typing python, then perhaps Honcho isn't that useful. But imagine that a few months have passed, and running your application is now substantially more complicated. You need to have the following running in parallel: a web server, a high priority job queue worker, and a low priority job queue worker. In addition, you've established that you need to run your application under a proper web server like gunicorn. Now the Procfile starts to be useful:

web: gunicorn -b "$PORT" -w 4 myapp:app
worker: python --priority high,med,low
worker_low: python --priority med,low

Again, you can start all three processes with a single command:

$ honcho start

As you add features to your application, you shouldn't be forced to bundle everything up into a single process just to make the application easier to run. The Procfile format allows you to specify how to run your application, even when it's made up of multiple independent components. Honcho (and Foreman, and Heroku) can parse the Procfile format and run your application.

Why did you port Foreman?

Foreman is a great tool, and the fact I chose to port it to Python shouldn't be interpreted as saying anything negative about Foreman. But I've worked in Python-only development environments, where installing Ruby just so I can run Procfile applications seemed a bit crazy. Python, on the other hand, is part of the Linux Standard Base, and so even in "Ruby-only" environments, Python will still be around.

(Oh, and I also I wanted to learn about asynchronous I/O in Python.)

Installing Honcho

If you have a working Python and pip installation, you should be able to simply

pip install honcho

and get a working installation of Honcho. You can probably also easy_install honcho. But please, don't: get with the program.

Further reading and assistance

For more about the Procfile format, .env files, and command-line options to Honcho, see :ref:`using_procfiles`.

If you have any difficulty using Honcho or this documentation, please get in touch with me, Nick Stenning, on Twitter at @nickstenning or by email: <my first name> at whiteink dot com.

Indices and tables