I recently learnt Python. I liked it. I just wanted to use it for web development. This thought caused all the troubles. But I like these troubles 🙂
Coming from PHP world where there is only one way standardized. I expected the same and searched for python & apache.
Setting up Python on Windows/ Apache? says
Stay away from mod_python. One common
misleading idea is that mod_python is
like mod_php, but for python. That is
not true.
So what is equivalent of mod_php in python?
I need little clarification on this one How Python web frameworks, WSGI and CGI fit together
CGI, FastCGI and SCGI are language agnostic. You can write CGI scripts in Perl, Python, C, bash, or even Assembly :). So, I guess mod_cgi , mod_fastcgi, mod_scgi are their corresponding apache modules. Right?
WSGI is some kind of optimized/improved inshort an efficient version specifically designed for python language only. In order to use this mod_wsgi is a way to go. right?
This leaves out mod_python. What is it then?
Apache -> mod_fastcgi -> FLUP (via CGI protocol) -> Django (via WSGI protocol)
Flup is another way to run with wsgi for any webserver that can speak FCGI, SCGI or AJP
What is FLUP? What is AJP? How did Django come in the picture?
These questions raise quetions about PHP. How is it actually running? What technology is it using? mod_php & mod_python what are the differences?
In future if I want to use Perl or Java then again will I have to get confused? Kindly can someone explain things clearly and give a Complete Picture.
mod_pythonis the most likemod_phpin what it does (ie. it tries to do everything). That’s not necessarily a good thing and I wouldn’t recommend writing applications to the native mod_python interfaces today.The difference is WSGI is defined in the Python language itself: it specifies what objects and values your code will receive. [S|Fast]CGI are more concerned with bytes on the wire.
By writing your application to the WSGI standard (either directly, or using a framework that supports it), you are uncoupling the concerns of application-writing and deployment.
It’s a way to go, and definitely a good choice for Apache users, but far from the only one. Write to WSGI and you can deploy in a wide range of environments, including [S|Fast]CGI and mod_python.