Back to feed

Running Python ASGI apps in the browser via Pyodide + a service worker

Simon Willison's Weblog

May 30, 2026

5/30/2026

Service Workers Restore JavaScript Execution And Plugin Compatibility For Python Web Apps

Running Python ASGI apps in the browser via Pyodide + a service worker · Simon Willison's Weblog

Science, Technology & Innovation · May 30, 2026

Replacing the old Web Worker navigation-interception approach with service workers lets returned HTML run its embedded <script> tags, restoring Datasette features and plugin compatibility that previously broke when JavaScript in returned pages wasn’t executed.


5/30/2026

Browser-Based Python Web Apps Run ASGI In The Browser With Pyodide And A Service Worker Eliminating The Need For A Backend Server

Running Python ASGI apps in the browser via Pyodide + a service worker · Simon Willison's Weblog

Science, Technology & Innovation · May 30, 2026

Simon Willison demonstrates running Python ASGI apps entirely in the browser by combining Pyodide (WebAssembly) with a service worker that intercepts same-origin /app/ requests and executes them via ASGI, removing the need for a backend server aside from static file hosting and enabling static-hosted interactive Python apps.


5/30/2026

Datasette Lite Upgrade Moves From Prototype To Product Integration With Service Worker Architecture

Running Python ASGI apps in the browser via Pyodide + a service worker · Simon Willison's Weblog

Science, Technology & Innovation · May 30, 2026

A working service-worker–based Pyodide implementation has convinced Willison to upgrade Datasette Lite, signaling the approach may shift from prototype to integrated, maintained product and restore richer browser/plugin behavior broken by the old Web Worker approach.


5/30/2026

General ASGI Infrastructure Demonstrated Across FastAPI And Datasette Shows Cross-Framework Portability

Running Python ASGI apps in the browser via Pyodide + a service worker · Simon Willison's Weblog

Science, Technology & Innovation · May 30, 2026

The implementation is presented as general ASGI infrastructure—demonstrated on both a minimal FastAPI FastCGI demo and the full Datasette app—providing evidence that the pattern is portable across ASGI-based Python frameworks and enabling teams to experiment with in-browser execution and new distribution channels without rewriting application models.