Python 2.7 with Webpy - flup or modwsgi?

2019-08-11 18:40发布

问题:

I am unsure which of the two I should go for. Flup or modwsgi.

Flup seems to have very little documentation and even less people adding to the code. modwsgi on the other hand seems to be widely supported.

I just want to start running my webpy environmental so that I can utilize Python scripts online. But this thing stops me from moving ahead. Any suggestions?

回答1:

My understanding is that flup's author has discontinued development, but that's at best a rumor (someone please correct me!). I use flup in FastCGI mode on several Django sites, because it comes pre-integrated with Django, so it's an easy choice. I've never had a problem with it, beyond some oddities in the formatting of command line options.

I don't know much about mod_wsgi, as we switched from Apache to Nginx some time ago.

One downside of Flup/FastCGI is that you're managing your own server processes, whereas with mod_wsgi, Apache manages the processes for you.

web.py appears to have a good cookbook section with recipes for either solution. mod_wsgi looks like the simplest solution to me.

If you don't mind managing your processes (I don't), I understand there's been some excitement and momentum surrounding Gunicorn and uWSGI. These may be worth checking out. I've used Gunicorn with Django and Tornado web servers, and have no complaints about it.



回答2:

I use nginx and uwsgi to deploy my own web.py apps, seems faster and consumes less ram than apache+mod_wsgi, the setup is not as easy though. I have to run supervisord to ensure that all uwsgi processes are on.

Don't use flup, I think its considered to be a bit outdated way of deploying python web apps.