Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

noo not the cgi module :(


You 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.


I 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.


The 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.


Especially 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.


You 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: