5 ms·
noo not the cgi module :(
by robobro 7y ago
noo not the cgi module :(
- zestyping 7y agoI was wondering about that too. CGI is still just about the easiest and most universally supported way to serve dynamic web content from a Python script. The complaint is that the module is designed poorly, which is fair; to remove CGI support without any "batteries included" replacement seems a bit of a shame, though.
- skykooler 7y agoEspecially as, if you're in a situation where you have to use CGI rather than a better server worker solution, you probably also don't have access to the environment to install pip packages.
- mjw1007 7y agoThe cgi module doesn't actually contain anything CGI-specific. It dates from a time when "CGI" was a sensible shorthand for "handling http requests". What's actually in the module is a rather clunky, but serviceable, system for processing html form data.
- ptx 7y agoYou can use wsgiref.handlers.CGIHandler instead, with the advantage of being able to easily move the application to some more appropriate WSGI environment later if needed.
- draegtun 7y agoYou have to keep moving forward with the times! Perl removed CGI from its core back in 2014 - https://perl5.git.perl.org/perl.git/commitdiff/e9fa5a80 https://perl5.git.perl.org/perl.git/commitdiff/e9fa5a80