How I deployed My django app on IIS 7

So in work(Citrix),

We’ve been working on a django based application to analyse debug data from XenServer..

I was asked to deploy the application internally in such a way that availed of AD Single sign on in our intranet.. ┬áThis would mean that I’d have to run it on a windows box and avail of Kerberos or NTLM authentication..

This posed a problem for me.. My application depends a lot on some standard Linux commands(grep, busybox etc)

So I decided to keep the application running on a Linux machine, and try to use some protocol to proxy the requests from IIS, which would be doing the authentication.. I would use the REMOTE_USER header to identify the user authenticated.

I tried apache with fastcgi and mod_auth_sspi.. but the authentication was flaky, sometimes worked, sometimes didn’t..

I decided that I needed to use IIS if I was to get stable authentication… But its fastcgi implementation didnt support sending the request to another box.

I was running out of ideas.. then I seen that there was a AJP connector for IIS which comes from the apache tomcat project in the form of isapi_redirect. So I gave it a go..

I used flups ajp implementation on the django side.. everything was going great, I could authenticate using IIS and the request was passwd back to the django box..

Except for one thing.. My application requires a large file upload(~100mb).. and it took hours.. i.e. 20kb/s. I first thought it was IIS.. but no. Flups AJP implementation is very very slow.

I seen that flups author also had a C based project, ajp-wsgi, I tried it out and it was much better very reliable.. there was a small hick-up at the start but allen patched that up.. Thanks..

So in essence, If you need windows authentication, and you need your django app to run on Linux.. use IIS, isapi_redirect, and ajp-wsgi..

One Response to “How I deployed My django app on IIS 7”

  1. Ruslan Says:

    Thanks for sharing your experience. I’m going to do nearly the same. Would it be too much to ask if you could share some of your Django code? The part that handles authentication.

Leave a Reply

Copyright © 2018 All Rights Reserved.
No computers were harmed in the 0.076 seconds it took to produce this page.