web.py is a minimal Python web framework that provides the core components needed to build web applications: URL routing, template rendering, database access, form handling, and session management. The framework uses a convention-based approach where URL patterns are automatically mapped to handler classes based on their names, eliminating the need for manual route configuration. It exposes applications as WSGI callables, making them deployable with any WSGI-compliant server.
The framework distinguishes itself through its metaclass-driven auto-discovery system, which automatically registers handler classes and builds URL mappings at class definition time. It includes a built-in template rendering engine for generating dynamic HTML pages, a database abstraction layer for executing SQL queries and returning structured results, and a form validation system that creates HTML forms and validates user-submitted data against defined rules. The middleware hook system allows custom processing logic to be inserted before or after request handlers, while the session management system maintains per-user data across requests using server-side storage.
Beyond its core capabilities, web.py supports multi-app hosting through subdirectory, subdomain, or URL-prefix-based routing, and provides configurable HTTP error page generation for standard error codes. The framework includes a built-in development server for local testing, CGI script serving for platforms like Google App Engine, and an application testing utility that simulates HTTP requests with custom paths, methods, and headers.