Friday, August 08, 2008

Django on IronPython with Jeff Hardy and NWSGI

Jeff Hardy is the creator of NWSGI, a .NET implementation of the Python WSGI web standard that recently reached version 0.4. For those who might not know, WSGI is modern web specification (like CGI all grown up) specifically for Python. It allows components of web applications to communicate.

Most Python web frameworks speak WSGI (pronounced wizz-gee), including the best known Python web framework Django (which is approaching a full 1.0 release). Jeff Hardy has been developing NWSGI by running Django on IronPython with the Cassini web server.

It seems like Django has become the standard 'compatibility-test' for Python implementations. Both Jython and PyPy have been working on improved Django compatibility performance, and Dino Viehland demonstrated Django on IronPython at this year's PyCon in Chicago.

Jeff has started a blog tracking the progress of Django with NWSGI, including any necessary patches. In the first two entries he describes getting the Django admin panel to run and in the third he talks about databases with IronPython and Django (both SQLite and MS SQL Server):
It is still an open question as to whether an unmodified Django will ever run on IronPython 2.X. Django 1.0 uses (or used to use last time I checked...) the difference between byte-strings and Unicode strings to determine whether it is serving text or binary data. IronPython has Unicode strings (and no byte-strings) so this strategy won't work without some other flag (or way of patching in a compatible 'bytes' type implementation). Jeff certainly seems to be making good progress though.

The fourth blog entry is the announcement of NWSGI 0.4, with a few more details:

2 comments:

  1. Maybe all will be well once Django runs on Python 3.0 implementations when the unicode/str distinction officially disappears. I can barely wait to start on Jython 3.0 for this reason (though wait I must: 2.x comes first!)

    ReplyDelete
  2. Python 3 is one solution - but that's a long way off before it is the defacto standard and there needs to be a way to run Django on IronPython before then. It doesn't necessarily need to be an unpatched Django though...

    ReplyDelete

Note: only a member of this blog may post a comment.