Wednesday, January 21, 2009

Django-Jython: Working With Experimental Database Backends - Part 1

This is the first of several blogs that I plan to publish regarding the use of experimental database backends with the Django-Jython project. In this series of blogs, I will cover the basics of how to begin using the experimental backends, as well as some details on how to create your own. At the time of this posting, only one "fully supported" backend exists for the Django-Jython project and that is for the PostgreSQL database. However, another experimental backend exists for SQLLite and there are more on the way.

In order to build and begin using the experimental backend for SQLLite (or others), you must first obtain a copy of the code, which is available on the project site, or via your command-line using the following line:

svn checkout django-jython-read-only

Once you've obtained the code, it is easy to build. Simply traverse into the root directory of the downloaded code which should be named "django-jython", and perform the build using the build script as such:

jython build

Now, this works nicely for a build to use the PostgreSQL backend, but it will not include the experimental backend implementations. In order to do so, you must open up the script and add the experimental backend that you wish to use within the "packages" listing as follows:

from distutils.core import setup
name = "django-jython",
version = "0.9",
packages = ['doj',
'doj.backends..zxjdbc.sqllite', # Experimental backend

Once you've added this to the script, it will cause the experimental code to be built the next time the build process is invoked. Now you can begin using the new backend.

Next time I plan to delve into the process of creating your own experimental backend for the Django-Jython project!

No comments:

Post a Comment

Please leave a comment...