Python Tools for the Web - BKJackson/BKJackson_Wiki GitHub Wiki
Subpages
General Web Tools
- How to Set Up a Local Web Server on Windows, Mac, and Linux
- Requests Advanced Usage - covers proxies
Python Web Tools
message_flow - Experiment using messaging for real-time connection between JS frontend and Python backend. Uses Flask.
Tornado
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user.
Tornado is different from most Python web frameworks. It is not based on WSGI, and it is typically run with only one thread per process. See the User’s guide for more on Tornado’s approach to asynchronous programming.
The Tornado web framework and HTTP server together offer a full-stack alternative to WSGI. While it is possible to use the Tornado HTTP server as a container for other WSGI frameworks (WSGIContainer), this combination has limitations and to take full advantage of Tornado you will need to use Tornado’s web framework and HTTP server together.
Nginx (engine-X)
The second most common web server among the top 100,000 websites.
Nginx is commonly used as a web server to serve static assets such as images, CSS and JavaScript to web browser clients.
Nginx also functions well as a reverse proxy to handle requests and pass back responses for Python WSGI servers or even other web servers such as Apache.
Nginx Articles
- About NginX - From Full Stack Python
- Nginx for Developers: An Introduction - Nginx is a fast and extremely powerful http and reverse proxy server that can be used to quickly and easily serve webpages. After struggling with it myself for a bit, I finally got down the basics of how to work with nginx, and wanted to share it so that other developers would have an easier time picking it up.
- Hacker News broke our site – how Nginx and PageSpeed fixed the problem
- Deploying a Python application on Passenger and Nginx
Articles:
- A Pattern for Websockets in Python - This article presents a simple recipe for adding WebSocket support to your Python web server. It works with any WSGI server (Flask, Django, Pylons, etc.), and allows scaling up as demand increases. The full source code is available online at https://github.com/cesium-ml/message_flow.
Python HTTP/HTTPS Requests and Proxies
Python Requests And Proxies - blog from 2013
How to download files from the web with Python - Jan. 2018, requests, urllib
How to use proxies with Python requests module - Aug 22, 2019