- Python Network Programming - Home
- Python Network Introduction
- Python Networking - Environment Setup
- Python Networking - Internet Protocol
- Python Networking - IP Address
- Python Networking - DNS Lookup
- Python Networking - Routing
- Python Networking - HTTP Requests
- Python Networking - HTTP Response
- Python Networking - HTTP Headers
- Python Networking - Custom HTTP Requests
- Python Networking - Request Status Codes
- Python Networking - HTTP Authentication
- Python Networking - HTTP Data Download
- Python Networking - Connection Re-use
- Python Networking - Network Interface
- Python Networking - Sockets Programming
- Python Networking - HTTP Client
- Python Networking - HTTP Server
- Python Networking - Building URLs
- Python Networking - WebForm Submission
- Python Networking - Databases and SQL
- Python Networking - Telnet
- Python Networking - Email Messages
- Python Networking - SMTP
- Python Networking - POP3
- Python Networking - IMAP
- Python Networking - SSH
- Python Networking - FTP
- Python Networking - SFTP
- Python Networking - Web Servers
- Python Networking - Uploading Data
- Python Networking - Proxy Server
- Python Networking - Directory Listing
- Python Networking - Remote Procedure Call
- Python Networking - RPC JSON Server
- Python Networking - Google Maps
- Python Networking - RSS Feed
Python Network Programming Resources
Python Network - Web Servers
Python is versatile enough to create many types of applications ans programs that drive the internet or other computer networks. One important aspect of internet is the web servers that are at the root of the client server model. In this chapter we will see few web servers which are created uaing pure python language.
Gunicorn
Gunicorn is a stand-alone web server which has a central master process tasked with managing the initiated worker processes of differing types. These worker processes then handle and deal with the requests directly. And all this can be configured and adapted to suit the diverse needs of production scenarios.
Important Features
- It supports WSGI and can be used with any WSGI running Python application and framework
- It can also be used as a drop-in replacement for Paster (ex: Pyramid), Django's Development Server, web2py, etc
- Offers the choice of various worker types/configurations and automatic worker process management
- HTTP/1.0 and HTTP/1.1 (Keep-Alive) support through synchronous and asynchronous workers
- Comes with SSL support
- Extensible with hooks
CherryPy WSGI Server
CherryPy is a self contained web framework as it can run on its own without the need of additional software. It has its own WSGI, HTTP/1.1-compliant web server. As it is a WSGI server, it can be used to serve any other WSGI Python application as well, without being bound to CherryPy's application development framework.
Important Features
- It can run any Python web applications running on WSGI.
- It can handle static files and it can just be used to serve files and folders alone.
- It is thread-pooled.
- It comes with support for SSL.
- It is an easy to adapt, easy to use pure-Python alternative which is robust and reliable.
Twisted Web
It is a web server that comes with the Twisted networking library. Whereas Twisted itself is "an event-driven networking engine", the Twisted Web server runs on WSGI and it is capable of powering other Python web applications.
Important Features
- It runs WSGI Python applications
- It can act like a Python web server framework, allowing you to program it with the language for custom HTTP serving purposes
- It offers simple and fast prototyping ability through Python Scrips (.rpy) which are executed upon HTTP requests
- It comes with proxy and reverse-proxy capabilities
- It supports Virtual Hosts
- It can even serve Perl, PHP et cetera