Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django on IIS: PyISAPIe or FastCGI or WSGI or Helicon Zoo or DjangoWindowsTools

I currently have a windows 2008 webserver running iis 7.5. I've successfully build PyISAPIe 1.1.0 for Python 2.7.4. Django is deployed and it works, fast. But as I know PyISAPIe is somehow old fashioned, last version release in 2010. I find out there are Helicon Zoo (WebPI packaged running WSGI bridge) and DjangoWindowsTools (automated deploy using Fascgi). So I would like to ask for your recommendation: which solution is best for django/python on IIS?

like image 286
James Avatar asked Apr 09 '13 08:04

James


1 Answers

I can see you've found one solution. You may like to know that Helicon Zoo also support FastCGI protocol for operation (not related to Microsoft FCGI module). Additionally it supports TCP protocol (like Nginx on Linux) with is useful for comet and long polling support. Plus it offers many additional features that Microsoft FCGI module does not have, like automatic load balancing and application scaling, slow POST attack protection and many others. With Web Platform Installer and Helicon Zoo I could shrink your initial bat file. Please review:

rem Default settings
SET SITE_NAME=Django Site
SET SITE_PHYSIC_PATH=C:\intepub\%SITE_NAME%
SET SITE_URL=*
SET SITE_PORT=8000
SET SITE_PROTOCOL=http

SET SITE_NAME="Enter site name (%SITE_NAME%):" %=%
SET /p SITE_PHYSIC_PATH="Enter project directory, which contain manage.py (%SITE_PHYSIC_PATH%): " %=%
SET /p SITE_PROTOCOL="Enter http|https for protocol (%SITE_PROTOCOL%): " %=%

SET /p SITE_URL="Enter site url (%SITE_URL%):" %=%
IF "%SITE_URL%"=="localhost" (
    SET SITE_URL="*"
)


ECHO.
ECHO Install IIS, Python, Helicon Zoo and other requirements if needed
WebpiCmd.exe /Install /Products:PythonModules /feeds:http://www.helicontech.com/zoo/feed/ /AcceptEula

ECHO.
ECHO Create IIS Site: %SITE_NAME%
md %SITE_PHYSIC_PATH%
%windir%\system32\inetsrv\appcmd add site /name:"%SITE_NAME%" /physicalPath:"%SITE_PHYSIC_PATH%" /bindings:%SITE_PROTOCOL%://%SITE_URL%:%SITE_PORT%
%windir%\system32\inetsrv\appcmd start site /site.name:"%SITE_NAME%"


ECHO.
ECHO Create Django application
echo ApplicationPath[@]%SITE_NAME%/>DjangoProject.app
WebpiCmd.exe /Install /Application:[email protected] /feeds:http://www.helicontech.com/zoo/feed/ /AcceptEula

This code can also install IIS, Python, Helicon Zoo and all other requirements on a complete clean system if needed. You will only need Web Platform Installer, which you can copy from other system where it is installed usually in C:\Program Files\Microsoft\Web Platform Installer No installation required.

like image 90
Yaroslav Avatar answered Sep 29 '22 19:09

Yaroslav