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!".


Wednesday, September 3, 2008

is checking out http://ping.fm

Monday, April 28, 2008

secure django+jetty+jython

UPDATE: since this is now 2 years old, and one of my key links is broken i've written a quick update here: http://tristanking.blogspot.com/2010/01/re-jettydjangojython.html

Today I enabled a ssl connector in jetty to run my django app securely. I then spent most of the day trying to figure out why HttpResponseRedirect's didn't work.

Turns out all I had to do was implement is_secure in my django handler.

updated servlet.py can be viewed here

Wednesday, April 2, 2008

iPod Touch On-The-Go FTW!

One thing that has always annoyed me about my iPod Touch is the inability to play all of an artists albums, album by album. You from the artist list, you can select a single album, or all songs for which you can play them in alphabetical order or shuffle mode.

I just figure this out! The trick is to use the On-The-Go playlist. Go to playlists and select the On-The-Go playlist. If there is stuff in it already you will have to hit the edit button (or clear it and start again). From there you navigate to your desired artist, and the button with is normally All Songs is now Add All Albums. click that, and then click done and play your playlist.

I don't know why i didn't look into this earlier. I guess i figurered i'd have to add all the songs one by one, but Apple has made it very simple. Still, a play all albums button in the standard menus would be much simpler!