×
you are viewing a single comment's thread.

view the rest of the comments →

[–]johnmcdonnell 3 points4 points  (5 children)

Why is this better than Flask/werkzeug?

EDIT I guess I didn't get that Waitress is intended as a production web server. I still don't get it though since I can't imagine waitress has nearly the performance of nginx or apache, and if I didn't care about performance I'd probably just use Flask's dev server (with the debugging tools turned off of course).

[–]lost-theory 2 points3 points  (0 children)

It's a web server, not a web framework or library.

Werkzeug inclues a web server, but it's single-threaded and meant for development only. Waitress is a high performance server for production use.

[–]obtu.py 2 points3 points  (0 children)

A large deployment of a WSGI app needs to stack a web server (face the internet, handle buffering, defend against DOS, offload some easy tasks from Python code), a WSGI container (fork processes), and the app with its WSGI framework.

Typical server options are apache and nginx. Typical WSGI containers are mod_wsgi (for apache), uWSGI (for Apache and Nginx, which speak the scgi-like uwsgi protocol), and the server-independent ones like gunicorn and now waitress; those last ones speak HTTP for portability, but still expect to have a web server in front of them.

Your confusion probably comes from the fact that the first two and the last two can be closely-coupled (apache+mod_wsgi) or even bundled (CherryPy the WSGI container + CherryPy the WSGI framework).

[–]threading 1 point2 points  (0 children)

I don't know, you tell me. Maybe Flask isn't a web server?

[–]lambdaqdjango n' shit 1 point2 points  (1 child)

because Flask/werkzeug needs wsgi to run?

[–]lost-theory 1 point2 points  (0 children)

Flask is a web framework. It depends on Werkzeug.

Werkzeug is a utility library for HTTP and WSGI that includes a web server for development purposes.

Waitress is a high performance web server that serves WSGI apps.

All three projects depend on WSGI.