Simon Willison 5/30/2026

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

Read Original

This article explores a novel approach to running Python ASGI web applications entirely in the browser via Pyodide (WebAssembly) and a dedicated service worker. By intercepting same-origin requests under `/app/` and executing them against the Python app using the ASGI protocol, the need for a backend server is eliminated except for static files. The method is demonstrated with a FastAPI demo and the full Datasette app, showcasing its generality. The author discusses overcoming limitations of previous Web Worker-based approaches, such as broken JavaScript execution, and plans to upgrade Datasette Lite accordingly.

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

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet