Navigation

This section is intended to get Pylons up and running as fast as
possible and provide a quick overview of the project. Links are provided
throughout to encourage exploration of the various aspects of Pylons.

To avoid conflicts with system-installed Python libraries, Pylons comes with a
boot-strap Python script that sets up a “virtual” Python environment. Pylons will then be installed under the virtual environment.

By the Way

virtualenv is a useful tool to create isolated Python environments.
In addition to isolating packages from possible system conflicts, it makes
it easy to install Python libraries using easy_install without
dumping lots of packages into the system-wide Python.

The other great benefit is that no root access is required since all
modules are kept under the desired directory. This makes it easy
to setup a working Pylons install on shared hosting providers and other
systems where system-wide access is unavailable.

To isolate further from additional system-wide Python libraries, run
with the –no-site-packages option:

$ python go-pylons.py --no-site-packages mydevenv

How it Works

The go-pylons.py script is little more than a basic virtualenv
bootstrap script, that then does easy_installPylons==1.0. You could
do the equivilant steps by manually fetching the virtualenv.py script
and then installing Pylons like so:

Activate the virtual environment (scripts may also be run by specifying the
full path to the mydevenv/bin dir):

$ source mydevenv/bin/activate

Or on Window to activate:

> mydevenv\Scripts\activate.bat

Note

If you get an error such as:

ImportError: No module named _md5

during the install. It is likely that your Python installation is missing
standard libraries needed to run Pylons. Debian and other systems using
debian packages most frequently encounter this, make sure to install
the python-dev packages and python-hashlib packages.

The command loads the project’s server configuration file in development.ini and serves the Pylons application.

Note

The --reload option ensures that the server is automatically reloaded
if changes are made to Python files or the development.ini
config file. This is very useful during development. To stop the server
press Ctrl+c or the platform’s equivalent.

The paster serve command can be run anywhere, as long as the
development.ini path is properly specified. Generally during development
it’s run in the root directory of the project.