William Ross
William Ross

Reputation: 3910

Adding a production server to Python Flask in Windows

I have an application setup in Flask and running on localhost in a Windows environment. All of the tutorials I have read said to not use the default Flask server in production.

The production servers Gunicorn and uWSGI both only work in Unix. Is there a way to run either one of those through Windows?

Or do I need to switch the project over to a UNIX development environment?

Upvotes: 11

Views: 23637

Answers (3)

MikeF
MikeF

Reputation: 1018

Waitress is a pure python solution for both Windows and Nix platforms that is no more complex to set up than the development server.

Upvotes: 2

Srgrn
Srgrn

Reputation: 1825

Even with this question answered I wanted to add that you can run wsgi apps on IIS which is a production level web server.

the easiest example is how flask can run on azure (IIS) but I saw a link explaining it even better https://heejune.me/2015/04/22/running-python-flask-on-a-local-iis-not-azure-with-wfastcgi-py/

Upvotes: 1

Matthew Daly
Matthew Daly

Reputation: 9476

There's many WSGI servers you can use to serve a Flask application. If you really need to deploy it to Windows, then I did find NWSGI, which might be worth a look.

I think it's fair to say that WSGI servers are few and far between on Windows, as this list only mentioned NWSGI. Unless you have a very good reason to deploy to Windows, I think you're probably better off opting for a *nix environment.

Upvotes: 5

Related Questions