How we created a TurboGears 2.1 app on Webfaction

Follow the instructions here:, modified as follows:

  1. Create the 'custom app listening on port' application named "rcl" on Webfaction through the control panel, then go back to the app list and make a note of the port number assigned to your app. Then, add your app to a website record.
  2. SSH into your server and run the following commands to install virtualenv and TG2:
# Create virtual environment

# Install virtualenv
easy_install-2.5 virtualenv # note the -2.5! For some reason it seems necessary.
# change to app directory
cd /home2/timblack1/webapps/rcl
# Create virtual environment
~/bin/virtualenv --no-site-packages .
# Activate virtual environment
source bin/activate

# Create TurboGears 2.1 app

# Download setuptools-0.6c9 since TurboGears 2.1 requires it
# Make directory for Python 2.5
mkdir ./lib/python2.5
# Install setuptools-0.6c9
easy_install -m ./setuptools-0.6c9-py2.5.egg
# Delete egg file since it's no longer needed
rm setuptools-0.6c9-py2.5.egg

# Install TurboGears 2.1
easy_install -i tg.devtools

# Start following instructions at
# Quickstart TurboGears project
paster quickstart rcl
# Install RCL into this virtual environment, download required packages
cd rcl
python develop
# Run nosetests as a smoke test to see if this TurboGears app is installed correctly

# Create app's database & serve on default port (port 8080)
paster setup-app development.ini
paster serve --reload development.ini

# If it's running satisfactorily, hit CTRL-C to kill the app
# Deactivate the virtual environment
  1. Edit development.ini to change the port number to the port assigned to your custom app.
  2. Start your app in daemon mode:
paster serve --daemon development.ini

That's it - your new TG2 site will be served on the website to which you assigned it in step 1!

Last modified 7 years ago Last modified on 05/31/10 19:16:18