June 2015
Intermediate to advanced
320 pages
7h 18m
English
So how does this all work in practice? Well as we saw with Flask, many frameworks come with their own built-in development web servers. However, these are not recommended for use in a production environment as they're generally not designed to be used where security and scalability are important.
Currently, probably the quickest way to host a Python web application with a production quality server is with the Gunicorn server. Using our Flask application from earlier, we can get it up and running using just a few steps. First we install Gunicorn:
$ pip install gunicorn
Next we need to slightly modify our Flask app so that it's use of __builtins__ works correctly under Gunicorn. In your tinyflaskapp.py file, find the line:
objs ...
Read now
Unlock full access