Tuesday, January 26, 2010

Re: jetty+django+jython

Today I recieved an email querying me about the missing servlet.py in my jetty+django+jython post, and upon looking for it, i was suprised I could not find it. I linked to it, and I assume I would have copy+pasted the link from a browser's address bar, but it does not show in the commit history in github, or on my old work repository. I assume I've done something bizzare with the repository and overwritten it with a different one after moving the code around and forgot about it.

Either way, I noticed a comment in the post from a few months ago (amongst all the spam!) so i figured i'd make an update post for others who stumble apon this.

Before I start, disclaimer time: this work is 2 years old, and as I am no longer working on the project I used this for I don't have the time/desire to check if it's still valid work or even if it still works. Jython and Django have both progressed a long way since I built this and i've not been keeping tabs on either community so it may be worth doing some searching to see if there's a more recent alternative to this (I seem to remember some similar work to this involving GlassFish).

Since I don't have time to put together detailed examples, what I will do is link to parts of the project I used this on and a breif explaination of what you "should" find in them.

http://www.hpc.jcu.edu.au/projects/kepler/wiki/Hydrant My dev page, nothing important here. Link to demo is dead as my demo server has been shut down since I no longer work there.

http://www.hpc.jcu.edu.au/projects/kepler/wiki/HydrantInstallInstructions Install instructions, which you don't want to follow (unless you like wasting your own time, or have particular interest in running kepler workflows [www.kepler-project.org] in a web environment) but what you do want to get from here is the details on how to modify the web.xml and pom.xml that i will link below. There are also some notes about the settings.py that may be of value. Notice that for my jython/django requirements I link to specific versions of each one. These were the versions that I had running when I did this work, It is most likely broken on newer versions.

http://www.hpc.jcu.edu.au/git/?p=jc124742/hydrant.git;a=blob;f=src/main/webapp/WEB-INF/web.xml;h=e3b336db94521628e5599add46e8578aa5094ef5;hb=master a more up-to-date web.xml (similar to the one on github, but pointing to a "django.handler" local to this project.

and this brings us to the missing servlet.py i moved this to jython/middleware, but it seems it never occured to me to move it into django-servlet project. my bad! http://www.hpc.jcu.edu.au/git/?p=jc124742/hydrant.git;a=tree;f=src/main/jython/middleware;h=3a448871c8a97a97078aa298b89687f2ce1cf302;hb=master.

This should give you enough to get things up and running (assuming things haven't changed too much in django/jython in the past 2 years). The only thing left to say is "Good Luck!".