Learning Python Network Programming

(Sean Pound) #1

Applications for the Web


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 with an nginx reverse proxy. Apache with
mod_wsgi is also an effective hosting approach.


We've covered a lot of ground in this book, and there's still plenty more exploring to
be done. We hope this book has given you a taste of what's possible and an appetite
for discovering more, and that this is just the start of your adventures in network
programming with Python.

Free download pdf