Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache2: mod_wsgi or mod_python, which one is better?

I am planning to write web service in python. But, I found wsgi also does the similar thing. Which one can be preferred?

Thank you
Bala

Update

I am still confused. Please help.

Better in my sense means:
1. Bug will be fixed periodically.
2. Chosen by most developers.
3. Additional features like authentication tokens like AWS, can be supported out of the box.
4. No strong dependency on version.( I see that wsgi requires python 2.6)
5. All python libraries will work out of the box.
6. Scalable in the future.
7. Future upgrade don't cause any issues.

With my limited experience, I want these features. There might be some I might be missing.

Thanks
Bala

Update

I am sorry for all the confusion caused. I just want to expose a restful web services in python language. Is there a good framework?

like image 342
Boolean Avatar asked Mar 10 '10 22:03

Boolean


2 Answers

mod_wsgi is more actively maintained and (I hear -- haven't benchmarked them myself!) better performing than mod_python. So unless you need exclusive features of mod_python, just to use a web app framework (or non-framework, like werkzeug;-), you're probably better off with mod_wsgi! (Just about every Python web framework, and many non-frameworks of which werkzeug is my favorite, support WSGI as their standard interface to the web server, these days).

like image 54
Alex Martelli Avatar answered Sep 27 '22 22:09

Alex Martelli


Don't confuse what WSGI and mod_wsgi are. WSGI is an interface specification for hosting Python web applications on a server. The mod_wsgi module is an implementation of the WSGI specification using Apache as the underlying web server. Thus, Python and WSGI are not choices exactly, WSGI is just one way of being able to communicate between a Python web service/application and the web server. The mod_wsgi package is one implementation of that interface. So, WSGI is a means to an end, not a solution in itself.

Personally, I'd very much suggest you just use a minimal Python framework/non framework and as Alex suggests, Werkzeug is a good choice.

like image 26
Graham Dumpleton Avatar answered Sep 27 '22 22:09

Graham Dumpleton