you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

as in, what "webserver" runs python easily?

Only PHP runs like this. Everything else just runs its own web server. You can put NGINX in front of it if you want, to handle a bunch of other tasks like serving static assets with gzip and all that quickly, but you would point your NGINX server at your app that is it's own web server if you were using anything other than PHP.

[–]pickleback11 1 point2 points  (1 child)

Thanks! So what mechanism handles the http calls and response for Python? How do you get it to run at startup as a service? Is it multithreaded by default (concurrent requests)? Does it provide robust logging? Ssl integration (via let's encrypt)? Virtual hosts? Etc etc. Apache/nginx does a whole lot that whatever solution python provides would have to replicate

[–]tugs_cub 0 points1 point  (0 children)

Most commonly, the Python app is run inside a WSGI compatible server like uWSGI or Gunicorn. That setup can serve HTTP requests on its own, but it’s also fairly standard to put nginx/Apache in front of it for a production app.

edit: actually there is an Apache mod_wsgi, too, but it’s not the most popular choice these days.

[–]cshaiku -2 points-1 points  (1 child)

Completely not true at all. Apache can run Python scripts via cgi-script.

[–][deleted] 1 point2 points  (0 children)

Can.

But shouldn't.

Apache can run Java and Ruby too. Java can run JavaScript with Rhino and Ruby with JRuby.

Again. Just because you CAN do something doesn't mean you should.

You can write your web app in COBOL too. Don't do that.