Turning a Pylons .ini file into an executable

by gldnspud on December 6, 2006

For me, it is convenient to be able to just run one command to start a development web server for a Pylons project, or any other project for that matter.

When creating a new Pylons project, you usually must invoke the "paster" script to start the development server:

$ paster serve --reload development.ini

Taking a cue from what RhubarbTart does, here is how I change my development.ini file in a Pylons project so that I can invoke it like this instead:

$ ./development.ini

At the top of the file, add this line:

#!/usr/bin/env paster

At the bottom, add this section:

[exe]
command = serve
reload = true
verbose = true

Make the file executable:

$ chmod +x development.ini

Leave a Comment

Previous post:

Next post: