Wednesday, September 24th, 2008 | Author: number.0

I managed to have CouchDB running with Django inside mod_python, everything was installed on my Slackware 12.1 development server.

1. mod_python is compiled for Apache2, if you don’t know how then proceed here
2. I used official release from Django, check out here if you need help with the installation
3. Install Erlang, CouchDB as described in my previous post
4. Install CouchDB Python binding is easy with easy_install couchdb
5. I set up a virtualhost to run my couchdb-django testing (/etc/httpd/extra/httpd-vhosts.conf)


ServerAdmin abc@abc.com
DocumentRoot “/srv/djangocouchdb”
ServerName django.dev.com

Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all


PythonPath “[r'/srv/'] + sys.path”
SetHandler python-program
SetEnv DJANGO_SETTINGS_MODULE djangocouchdb.settings
PythonHandler django.core.handlers.modpython
PythonOption django.root /couchdb
PythonDebug On

(well, i made my /etc/hosts file to have entry for django.dev.com for sure )

6. Then I followed instruction from HERE to create my django project and couchdb app inside that project. And everything worked, just with a little problem (access denied) with PYTHON_EGG_CACHE which in my system refered to /root/.python-eggs. I reset PYTHON_EGG_CACHE to /tmp and restarted my server, then everything worked fine.

Now it’s time to explore more :)

Share/Save/Bookmark

Category: programming, python
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses

  1. Try mod-wsgi. It’s much faster than mod_python an has less memory overhead. You should also consider serving your static files with a webserver like nginx or lighttpd, and let them proxy requests to your python projects.

    Btw. the man text on your site is hardly readable. Looks a little bit fuzzy.

    Greetings John

  2. Thanks for the comment, John :) I will take a look at mod_wsgi for sure, and for production one, nginx & lighttpd is a good fit for balancing the request.

    Hopefully text is readable now.

Leave a Reply