Summary
We've taken a whistle-stop tour of putting Python applications on the Web. We got an overview of web application architectures and their relationship to web servers. We looked at the utility of Python web frameworks, noting how they give us tools and structure to write better web applications more quickly, and help us integrate our applications with web servers.
We wrote a tiny application in the Flask web framework, we saw how it can help us elegantly manage our URL space, and how templating engines can help us cleanly manage the seperation of application logic and HTML. We also highlighted a couple of common potential security vulnerabilities— XSS and CSRF— and looked at some basic mitigation techniques.
Finally, we discussed web hosting architectures and the various methods that can be used to deploy Python web applications to the Web. In particular, WSGI is the standard protocol of web server/web application interaction, and Gunicorn can be used for rapid deployment and scaled...