3

In a related question I'm trying to figure out how a Python web application "ties together" from end to end, and I've been making the assumption that Apache/lighttpd/nginx is required with a WSGI module. (Let's assume I'm serving static content using a CDN.)

Is it possible to skip WSGI and use the gevent library to serve clients directly?

Matty
  • 33,203
  • 13
  • 65
  • 93

2 Answers2

1

gevent doesn't include a pre-made HTTP server, but it could be possible to write one using gevent.server. It's probably easier to use a lightweight WSGI container such as Paste Deploy though.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • 2
    Gevent **does include two HTTP-servers** -- gevent.wsgi.WSGIServer and gevent.pywsgi.WSGIServer. Those are HTTP-servers that can be used to serve WSGI-applications. While it is not the best deployment option either of them can be used without any frontend HTTP-server/reverse-proxy. – Alex K Dec 14 '12 at 00:55
  • As an addendum to Alex K's comment, note that in 1.0 gevent has only the pywsgi server, and the old wsgi one is gone (but now aliased to the pywsgi server for compatibility). (This seems to reflect changes in the underlying architecture rather than any real removal of functionality.) – Peter Hansen Mar 13 '14 at 20:57
0

You could but won't want to for non-toy applications, as its capabilities/security are limited. Nginx is a perfect companion though.

The author of gevent recommends using gunicorn.

Skipping wsgi (rather than the second http server) doesn't make much sense. It is merely a convention for programs to interface with each other.

Community
  • 1
  • 1
Gringo Suave
  • 29,931
  • 6
  • 88
  • 75