views:

305

answers:

3

I started learning Python using the IronPython implementation. I'd like to do some web development now. I'm looking for a python web development framework that works on the Microsoft technology stack (IIS + MS SQL Server). Django looks like an interesting framework but based on what I have read, getting it to work on the Microsoft technology stack seems very hard or not possible.

I want to lean a web framework that leverages python strengths, so ASP.NET is not an option here.

The reasons why I want to do Python on full Microsoft stack are:

  • We are a .Net shop and our production servers run the full Microsoft stack
  • With IronPython, I'll be able to interop with our product's existing .Net Libraries
  • Our existing database runs in SQL Server and I want to develop an app that queries that database
  • Deploying my Python projects to our server will not be allowed if I have to install another web server

Any recommendations?

+1  A: 

Django does in theory run on Windows, but using Apache and MySQL. It's not possible (and certainly not recommended) to run it on IIS.

I know you totally didn't ask this, but I have to advise that if you really want to get into Python web development then looking into a Linux technology stack is definitely the recommended approach. :)

Andy Hume
See edit to my original question for reasons why I want to use the MS stack.
Sly
+3  A: 

While perhaps not entirely mature, isapi-wsgi looks like a promising way to run the WSGI intermediate layer on IIS (I have no hands-on experience with it, but seems worth a try!). Once you have WSGI running just about any Python web framework, including Django, should run on top of it (my personal favorite is werkzeug, a non-framework of utilities on top of WSGI, but I realize it's probably a lower level of abstraction than most web developers prefer for typical web apps and websited).

django-mssql should let Django run fine on SQL Server and looks reasonably mature (again, no hands-on experience). If you prefer a more sophisticated obj-relational mapper, SQLalchemy claims to support MS-SQL "out of the box" with minor restrictions (e.g., no more than one IDENTITY column per table).

If you want to stick with IronPython, but can live with using SQLite instead of MS-Server, it should also be possible to use Django on IronPython with IIS.

Alex Martelli
@alex: I had already read Jeff's post on attempting to run Django tests on IronPython/IIS. According to his post, it did not work. If he could not run the tests, I suppose he can't use the framework either. Right?
Sly
@alex: The first two options you described would only work with CPython. Right? That's an option I'll look into if I really can't get a web dev framework to work on IronPython.
Sly
@Sly, in general, yes -- without the tests you can hardly have confidence that specific aspects of the framework as expected (some parts may work, but it's somewhat hit-and-miss whether that includes all the parts you need). Also yes, I started with CPython options (which I suspect give you a better chance to pass relevant tests).
Alex Martelli
+5  A: 

Working with the full MS stack will be hard as not many FLOSS frameworks aim there. You'll have better luck with a WAMP (Windows/Apache/MySQL-PostgreSQL/Python) approach.

That being said, Django works on Windows, and even can be made to work under IIS by using PyISAPIe and MS SQL Server support.

TurboGears can also be installed on Windows, and has MS SQL Server support through its ORM backends.

Trying to use -AMP under Windows can be an exercise in masochism sometimes. It can be done, but using these frameworks under Linux/BSD is much much easier and enjoyable. You should definitely try it.

voyager
If the OP intends to link to .net though Python using IronPython, what implications dose that create with using that code in Django?
JustSmith
@Smith325: If the project is entirely made in IronPython, you might have the risk of things breaking if trying to follow Django's trunk because of the possible nonexistance of some part of Python's standard library. Other than that (and having some headaches with the ORM layer) there should be no other implications except the possibility to use .Net's library and other existing components, but you could achieve a similar result by using Python for .Net http://pythonnet.sourceforge.net/
voyager