First of all, you need to make sure you have Python2.3 for FCGI (and I think Django) to work. For more details about getting fcgi working, see this thread. You also need to have shell access. If you don't, submit a ticket to ASO support.
First, open your shell and confirm your version of Python (be sure to use a Capital V):
If you have anything prior to 2.3.x you'll have to see about getting your server upgraded. (I'm told the new servers are at 2.3.x while the old are 2.2.x - if you just signed up for a new account, you should be good)
- Ok, assuming your on one of the new servers, it's time to get started. Although Django is now offered both as a tarball and from svn, I chose to install from subversion as its easier to update to latest trunk etc. In your shell, make sure you're in your HOME dir and do:CODEcd ~
svn co http://code.djangoproject.com/svn/django/trunk/ django_src
- Edit your PYTHONPATH and PATH vars so that Django is available from your shell.CODEexport PATH=$PATH:$HOME/django_src/django/bin
- Create a Django projects directory and create your first Django project.CODEmkdir django_projects
django-admin.py startproject myproject
- If you don't want other users on your shared host to have access to your DB settings, change the permissions on your myproject.settings file so that ONLY YOUR USER can read them. CODEchmod 600 myproject/settings.py
- Edit the myproject.settings (myproject/settings.py) file to add your database connection parameters.
- Initialize the database.CODEdjango-admin.py init --settings=myproject.settings
- Create a superuser account for use with the admin interface (follow the prompts).CODEdjango-admin.py createsuperuser --settings=myproject.settings
- Now its time to create the publicly available directory. Whether you set that up as a sub domain through CPanel or just create a sub-dir under ~/public_html (which you can always point to with a sub domain of the same name later) is your choice. For this exersize, we'll assume your just creating a sub-dir, which needs to have the fcgi.py script.CODEcd ~/www
chmod 755 fcgi.py
- Now you need to create a file named django.fcgi in the same dir, which should contain the following (replace 'username' with your username on lines 3 and 4 and 'myproject' with the name of your project if it differs from the example used above):CODE#!/usr/bin/python
sys.path += ['/home/username/django_src']
sys.path += ['/home/username/django_projects']
from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
- Set the correct permissions on django.fcgi.CODEchmod 755 django.fcgi
So that credit is made where credit it due, I copied most of this directly from the Dreamhost wiki making a few minor adjustments for differences in the server setup here at ASO.
When I get the rewrite rules etc worked out, I'll post them here as well. Of course, if someone has any insight, that would be great. In case your wondering, I'm tried many variations on the rules suggested on the Dreamhost wiki page I linked to above.