Setting Up Snowy on DreamHost


This guide is for installing Snowy in a shared hosting environment like DreamHost, where you must install your own Python, Django, and other dependencies locally. It is geared toward using FastCGI and Apache, and is based on , so please read that if anything here seems off.

Assumptions In This Guide

You can of course deviate from any of these, but here are the assumptions I'm making as I write this guide:

  • You have a working DreamHost domain with shell access

  • Apache looks in ~/ for website files
  • You also have ~/ sub-domain set up
  • You will install Snowy to ~/django-projects/snowy
  • FastCGI is enabled for


In a typical DreamHost setup, the first thing you need to do is install Python 2.6 and many modules in your home directory. In this example, we will use $HOME as the installation prefix (so install files will end up in ~/bin/, ~/lib, ~/share, etc). Before installing anything, it is probably easiest to modify your .bash_profile like so:

export PATH=$HOME/bin:$PATH
export PYTHONPATH=$HOME/django-projects:$HOME:$PYTHONPATH

The second line implies that we are going to install Snowy to ~/django-projects/snowy.

The first time after creating this, you'll need to run source ~/.bash_profile.

Now we have various tarballs we need to download and install to have an appropriate Python environment, starting with Python 2.6. Here's what I installed...I do not remember the order, but it was probably something like:

  • Python-2.6.2
  • setuptools-0.6c9
  • MySQL-python-1.2.3c1
  • python-dateutil-1.4.1
  • pytz-2009j
  • libxml2-python-2.6.21
  • pysqlite-2.5.5
  • Django-1.1

TODO: Test this again on a fresh dreamhost user/domain to record exact steps

Sorry for the lack of details at this time, but I'm guessing I did something like the following (after extracting all the tarballs to ~/tarballs):

cd ~/tarballs/Python-2.6.2 && ./configure --prefix=~ && make && make install
cd ~/tarballs/setuptools-0.6c9 && sh setuptools-0.6c9-py2.4.egg --prefix=~
cd ~/tarballs
easy_install MySQL-python-1.2.3c1
easy_install python-dateutil-1.4.1
easy_install pytz-2009j
easy_install libxml2-python-2.6.21
easy_install pysqlite-2.5.5
easy_install Django-1.1

Okay, now in theory you have a sufficiently prepared environment. Please double-check that the python command loads a Python 2.6 console. If it doesn't, add alias python=python2.6 to ~/.bash_profile.

Lastly, to set up the admin media properly:

ln -s $HOME/tarballs/Django-1.1/django/contrib/admin/media $HOME/

Setting up FastCGI

cd ~/

Then create the file ~/ with the following contents:

import sys
sys.path = ['/home/YOURDREAMHOSTUSERNAME','/home/YOURDREAMHOSTUSERNAME/django-projects','/home/YOURDREAMHOSTUSERNAME/django-projects/snowy'] + sys.path
from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'snowy.settings'

Set up permissions:

chmod 755 ~/ ~/

Edit ~/ :

RewriteEngine On
RewriteBase /
RewriteRule ^(dispatch\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]

Note that if you are putting your install in a subdirectory like ~/ , you will edit ~/, and RewriteBase should be set to /snowy, not /.

Setting up Snowy

I recommend getting Snowy from git. This allows you to see any changes you've made to your local checkout (and maybe send them back to us as patches). Also, you can switch to any arbitrary version for testing purposes. Upgrading to a new release could be as easy as git pull --rebase && git checkout SNOWY_1_2 (for example).

cd ~/django-projects
git clone git://
cd snowy
cat INSTALL  # Yes, you really should read this ;-)

I don't want to repeat the contents of INSTALL here, since then I'd have to maintain two documents. ;-) Read them and follow them. Just don't run python runserver , and when you're ready to admin your install, go to . Here is my (in this example I'm using sqlite:

# Local Django settings for snowy project.

DEBUG = True

DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '/home/YOURDREAMHOSTUSERNAME/django-projects/snowy/snowy.db'



# Fill in this information from

Make sure to:

chmod 600

If for some reason you really are using sqlite, please make sure that you put the .db file somewhere inaccessible to your web users.

Projects/Snowy/Install/Dreamhost (last edited 2013-11-22 20:53:50 by WilliamJonMcCann)