DjangoKit gets better
created 13 April 2007 in blog tagged django, pyobjc and python.
DjangoKit suffered a hiatus recently due to a non-anticipated hot beverage/keyboard intersection incident, but recently I’ve been able to poke at it again, and I have it in a much more flexible state now. Although the code itself is still scary and horrible, and I’m abusing distutils in a way that’ll get me into trouble soon, it’s now installable. Once installed, it can be used to turn any stand-alone Django application into a MacOS .app.
The best way of demonstrating this is with one of the two examples I have in the source tree. The TODO application is utterly trivial, and consists of only a model definition, an url dispatcher, and a template - I use generic views to look at the todo items, and the admin interface to edit them. I can now put a setup.py in the app folder with minimal application information, and run
python setup.py py2app
And produce an application. The other example was built after I had this working - it’s based on the wiki written by Paul Bissex that he was kind enough to point me at in the comments on the last DjangoKit blog post. The app itself needed tweaking slightly, but not for any DjangoKit-specific reasons, and now I have a setup.py that turns the wiki into an application.
The response to the first release of the thing was interestingly mixed. Some people were very enthusiastic, others either don’t see the point of, or actively dislike, GUI applications written using HTML frameworks. I think that, if I had to make a call, I’d be in the latter camp - there’s a reason all my other GUI apps are written in PyObjC and not, say, wxPython. I lose lots of portability, I gain much nicer-feeling apps. I just wanted to know if I could do it. And it might come in useful for something..