BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft shows Django running on IronPython

Microsoft shows Django running on IronPython

This item in japanese

Microsoft recently had the opportunity to show off some of the progress the Dynamic Language Runtime (DLR) team has made when they gave a demo of Django running on IronPython.  The accomplishment was shown during PyCon 2008 in Chicago, March 14-16, 2008.

This is a huge step for the team, to be able to run a widely-used framework, such as Django, on a dynamic language running on the .NET Framework.  Django is a mature web application framework written for Python and intended to create applications very fast with a clean and pragmatic design.  It is a framework developers normally use on Linux or some other platform where Apache and Python are found but this demo showed Django running on Microsoft's DLR, the IronPython language and SQL Server 2005.

Dino Viehland and Jim Hugunin provided the talk at PyCon titled "IronPython: The Road Ahead", summarized nicely by Brian Luft of the blog Unbracketed.  Dino's demo took at bit to get running:

For the demo, Dino showed us the latest Django release (v0.96) running on IronPython 2.0 Beta 1 (which was just released on Friday). He did have to make a few patches to get the demo running. Naturally they chose to use MS SQL Server for their database and Django does not support that database by default. A handful of one or two line changes to the Django source got it working for IronPython. Additionally, there was another one line change or two that had to do with handling unicode properly. He noted that with the trunk of Django that may no longer be an issue since Django now supports unicode throughout.

As for the demo itself:

Dion demonstrated the simple poll application that we're all familiar with from the Django official tutorials. He started with the vanilla version as would result from following the tutorials and then followed it up with a spruced-up version that included some video and image backgrounds, nice UI effects, and rich-client dynamic updating of the voting results. All of this was of course accomplished with a minimal amount of Python code

Dino explains the first step in getting Django running was getting a database provider that would run on .NET and work with Django.  He describes PEP 249 as the Python Database API Specification which needs to be followed to create the basic database provider used.

IronPython v2.0 beta 1, released this past week, runs on the DLR is available on CodePlex.  Additional information about Django can be found at the Django Project.

Rate this Article

Adoption
Style

BT