←back to thread

53 points heavensteeth | 3 comments | | HN request time: 0s | source
Show context
zoobab ◴[] No.43653287[source]
Python has cgi-bin support, I made a proxy of the poor like this:

$ mkdir cgi-bin $ echo -e "#!/bin/bash\necho -e \"Content-type: text/html\n"curl -s -k http://www.zoobab.com -o -" > cgi-bin/proxy.sh $ python -m http.server --cgi 8000 $ curl http://localhost:8000/cgi-bin/proxy.sh

You should get the html page of http://www.zoobab.com

replies(2): >>43653841 #>>43654809 #
smittywerben ◴[] No.43653841[source]
Python removed cgi-bin calling it a dead battery module.

> cgi — Common Gateway Interface support Deprecated since version 3.11, removed in version 3.13.

https://docs.python.org/3/library/cgi.html

replies(2): >>43654137 #>>43655992 #
at_a_remove ◴[] No.43654137[source]
A shame, I used to use cgi all the time, back when I did web stuff. I wouldn't know what to do now, especially on IIS. Never did understand why I ought to want or need WSGI, other than I "ought to." Nor did I see how I was supposed to code against it, so I simply did cgi. It never raised a problem for me.
replies(1): >>43657530 #
1. mxuribe ◴[] No.43657530[source]
When i started dabbling in python back in the day, and when i had a need for cgi-bin sort of functionality (for simple web front-end), i think it was the sunsetting of popularity of python cgi, and more of the rise of WSGI...so there was less blog posts out there showing best practices around cgi, and more on wsgi...and to me it often felt like i was doing more unnecessary work via wsgi...but then, maybe i'm old and stodgy, and came from the php world prior to dabbling python? Then again, even though i feel i am more mentally sharper now than my younger self...it sure feels like back in the day i was able to be more productive sooner...and nowadays there's just so much setup and harnesses to begin with.
replies(1): >>43664531 #
2. at_a_remove ◴[] No.43664531[source]
I think started a little earlier, back when every site had a cgi-bin directory.

And, yeah, so much ... cruft now, and I rarely hear reasons for the tradeoff, other than "should" and "It will be great."

And if it is so great, why did it go away?

replies(1): >>43665406 #
3. mxuribe ◴[] No.43665406[source]
Thanks for making me feel good knowing that i'm not the only one feeling that there's too much cruft in some areas nowadays! :-)

Simiarly, i either hear no discussion about tradeoffs, or they tend to be so vauge or weak...and it eventually boils down to "Ain't no body got time to figure out the 'right way', and this new $thing is popular, so this new way is the right way everyone...".

As far as why it went away, i frankly don;'t know...but i imagine for the same reasons other good stuff goes away: maybe contributors stopped working on it, or there is money to be made in the new ways, or the zeitgeist of the new way (due to management consultants whispering in the ear of IT senior leaders) takes over the attention of the everyday devs, etc. Then again, i suppose if one were to preserve certain local infra. in a way to use old stuff, i guess one may still be able to run things the old way...but that's an uphill battle, and likely not worth it.