Django! (Problems...)

software development


I’ve followed the Wiki to the smallest detail… gone step by step. Everything seems to work (SQL conns, Paths, etc) until I try and actually visit a URL.

One of two things happens. Either the connection times out, or I get a 500 error.

I’ve tried making the little test-app to test FastCGI - also a no go, which leads me to believe that’s the culprit.

I’ve been scouring the net for anything and everything… including having to kill fcgi processes. It appears as though the process isn’t even getting started.

So basically… has anyone else been having trouble with installing Django? I’ve got FastCGI enabled… downloaded all the appropriate software… configured the appropriate settings… and still nothing…



I got django working on my dreamhost account recently.

Check your http server log files ($HOME/logs/ - they should be informative, and let us know what the error message is. One issue I ran into is that the database driver doesn’t expect to be used from multiple threads (as you get with Dreamhost’s FCGI), so you have to apply a patch to the django db driver. I found the patch at

The patch was for mysql and I was using sqlite3 so I manually applied similar changes to the file django/score/db/backends/ and it seemed to work.


Thanks for the reply.

I’ll try the patch, though I don’t think that’s the problem I’m encountering this moment (though that’s not to say it won’t trip me up later).

I attempted to run a plain-Jane fcgi test file… same error as before.

Here she blows (note: the file shown here is django.fcgi, but it’s the same whether or not it’s this file or something else):

Connection reset by peer: FastCGI: comm with server “/home/username/” aborted: read failed


Here’s my setup. (Using the account name XYZ as an example)

/home/XYZ/src/python - my python source tree. this directory goes into my PYTHONPATH
/home/XYZ/src/django_src - django sources. this also goes into PYTHONPATH
/home/XYZ/bin,lib,include - anything I had to compile or install that wasn’t on dreamhost

I installed python 2.4 and sqlite3 from sources. When building anything from source I set --prefix=/home/XYZ
My top level python package is APP, so for example is located in /home/XYZ/src/python/APP/

in /home/XYZ/.bash_profile:
export PATH=$HOME/bin:$HOME/src/django_src/django/bin:$PATH
export PYTHONPATH=$HOME/src/django_src:$HOME/src/python

in /home/XYZ/
set the rewrite rules as documented in the wiki. For example,
RewriteRule ^(.*)$ django.fcgi/$1 [L]

The contents of /home/XYZ/
#!/usr/bin/env python
import sys
from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os
os.environ[‘DJANGO_SETTINGS_MODULE’] = 'APP.settings’
WSGIServer(WSGIHandler()).run() is in the same directory as django.fcgi.
Double-check the permissions to make sure that all files are readable by the XYZ user, and that the database, and any other files or directories that are updated by the web application are writable by the XYZ user.