Have the latest django from svn.
$ svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk
If you haven't already done so, continue setting up as per the instructions at Django's site.
Get the latest jython from svn. Pre 2.5 will NOT work.
$ svn co https://jython.svn.sourceforge.net/svnroot/jython/trunk/ jython
$ cd jython
$ export PATH=$PATH:`pwd`/dist/bin
Get django-jython from svn.
$ svn co http://django-jython.googlecode.com/svn/trunk/ django-jython
$ cd django-jython
$ jython setup.py install
This was the part that caused most of the headaches, getting sqlite to work.
Add the .jar to your $CLASSPATH.
$ export CLASSPATH=$CLASSPATH:/path/to/jar/sqlitejdbc-v###.jar
Add Django to your $JYTHONPATH.
$ export JYTHONPATH=$JYTHONPATH:/path/to/your/python/libs/site-packages/django
On OS X, this is /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django .
Add django-jython to $JYTHONPATH.
$ export JYTHONPATH=$JYTHONPATH:/path/to/django-jython
You should be able to create new Django projects with
$ jython django-admin.py startproject projname
Edit your mydjangoproject/settings.py to include the sqlite3 database backend provded by django-jython.
DATABASE_ENGINE = 'doj.backends.zxjdbc.sqlite3'
Syncdb and runserver.
$ cd mydjangoproject
$ jython manage.py syncdb
$ jython manage.py runserver
syncdb outputs a big nasty error for me. This is an issue with jython and developers are looking at it now. My project still seems to work after this error, but don't use this for any important data because it's not guaranteed to work.
When starting your project, you may encounter the following error:
Error: Could not import settings 'mydjangoproject.settings$py' (Is it on sys.path? Does it have syntax errors?): No module named settings$py
This is because jython generates a "settings$py.class" when it compiles it, and manage.py loads this thinking it's settings.py. You can delete settings$py.class each time before you attempt to use manage.py, or apply this patch by Frank Wierzbicki.
I'm writing this entirely from memory, so I almost certainly have forgotten some steps. Please mention any trouble you have via comments to this blog post so I can update my post accordingly.