There is a possibility I can convince a customer of mind to switch
from ASP.NET MVC to web2py. The catch? It must run under IIS 6 with
SQL Server 2005. Are there others hosting production web2py apps
under IIS 6 with MSSQL 2005? If so, how was the setup experience?
Difficult, easy? Any unexpected gotcha?
I searched the mail group and read the other IIS related threads so my
gut tells me there are not a lot of people using web2py with IIS. But
maybe I'm wrong.
Thanks,
-KIRBY
Paul
I feel close to having this working using IIS6+isapi-wsgi+web2py
+mssql. I have encountered an issue within web2py and I'm not sure
how to get around it. I'll talk about the error at the end of this
message, but first here is the basics for setting up isapi-wsgi with
web2py under IIS. I can provide better documentation later after I
have everything working. (Note: I have only tested under IIS6.)
My goal is to use isapi-wsgi + web2py under IIS. To accomplish this
you must install the following (in this order):
Python 2.5.4
http://python.org
Python for Windows Extensions
http://sourceforge.net/projects/pywin32/
isapi-wsgi
http://code.google.com/p/isapi-wsgi/
There is a known bug using Python for Windows Extensions through ISAPI
using Python 2.6.1. This bug has been fixed in the [yet to be
released] Python 2.6.2 and Python 3.0.1. This is really not an issue
for web2py developers because web2py doesn't yet support these 2
versions of Python. Still it's good to know (for people like
me<grin>). More information on the bug is available here:
http://sourceforge.net/tracker/index.php?func=detail&aid=2609380&group_id=78018&atid=551954
I created a new handler called isapi-wsgihandler.py (see attached)
that is based on web2py's own wsgihandler.py and added it to the root
web2py directory. To install this ISAPI extension and setup a website
under IIS, execute the following command line:
python isapi-wsgihandler.py install
This will setup a virtual directory under IIS called web2py. The
virtual directory name is set in the isapi-wsgihandler.py and the
local URL is:
To remove the site and uninstall the ISAPI extension from IIS, execute
the following command line:
python isapi-wsgihandler.py remove
To see error messages and print statements while testing the website
under IIS run Win32TraceUtil.py found in the directory C:\Python25\Lib
\site-packages\win32\lib.
Okay, that's it for the setup. Now on to the issues I encountered
with web2py.
I received an error within web2py that said sys.argv did not exists so
I added the following to isapi-wsgihandler.py:
sys.argv = ['']
This fixed the problem but I'm not sure of the impact. After doing
this I now get this error message:
Traceback (most recent call last):
File "C:\Python25\lib\wsgiref\handlers.py", line 92, in run
self.result = application(self.environ, self.start_response)
File "gluon\contrib\wsgihooks.py", line 33, in __call__
self.__callback(self.__environ)
AttributeError: ExecuteOnCompletion2 instance has no attribute
'_ExecuteOnCompletion2__environ'
I'm not sure how to get around this issue. Any suggestions on a fix?
That's the status so far. As I said I feel like this is very close to
working, which will be great.
Meanwhile, I'm still waiting to hear back from my customer with a yay
or nah to use python + web2py instead of ASP.NET MVC. At the moment
it looks like the customer is going to okay the move, which will make
me very happy even if I have to host the app under IIS.
Thanks,
-KIRBY