Score:1

Is serving a Python Flask web app with IIS/Win Server (on prem) worth the trouble?

cn flag

There are a few resources (very few from what I can tell) suggesting that serving a Python web app from IIS is doable, but I've not heard or read any real world stories about this in practice.

I want to know if this approach is even worth considering in an organization that's almost exclusively a Windows shop.

Is up-skilling and investment in running Python from say an Ubuntu machine (for which there is at least some knowledge in the org) a vastly better option?

This is for on-prem deployment on VMs. Running Python on a cloud service is a completely different story obviously.

Michael Hampton avatar
cz flag
I've never heard of _production_ Python apps being run behind IIS, or on Windows for that matter, but I suppose anything is possible. Technically you can certainly do it; it's little different to proxying any other web app.
mforsetti avatar
tz flag
Rather than (reverse) proxying, IIS do [support WSGI](https://docs.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2019) via [`wfastcgi`](https://pypi.org/project/wfastcgi/); though there'll be differences on using Python in Windows versus *nix, especially if you start using external modules.
davidlars avatar
cn flag
Thanks, the wfastcgi approach looks worthwhile to look into. Hopefully use of external modules doesn't turn out to be a problem. The load on these apps won't be too bad. Internal apps for a limited set of users. Well, I guess it won't hurt to try. Definitely seems like a rare practice with little help anywhere if/when things goes south.
Score:3
vn flag

Python on IIS/Azure App Services (Windows) was quite a popular option to go (when Azure was still called Windows Azure), for production sites as well. You can utilize either HttpPlatformHandler or wfastcgi, so that IIS forwards traffic to the Python processes.

However, the real challenges come from the fact that Python web frameworks/apps are usually not quite well developed/tested on Windows, so if anything breaks you are almost certain to be the minority user base that many framework/app vendors neglect.

Even Microsoft decided to abandon its attempts on Python on IIS/Windows, and urges its customers to migrate to Azure App Services (Linux),

Important

Microsoft has deprecated the Python extensions for App Service on Windows as described in this article in favor of a direct deployment to App Service on Linux.

https://docs.microsoft.com/en-us/visualstudio/python/managing-python-on-azure-app-service?view=vs-2019

So which way to go isn't hard to see.

For on-premise, you can use Windows Server to host Linux VMs (Hyper-V) or use Linux Docker containers, or use a Linux server box directly. Even the most Windows centric customers I worked with have some Linux Docker containers running today.

Note that this is not only applicable to Python web apps. PHP/Go/Java/Node.js web apps face the same challenges, so they are better to be hosted on Linux.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.