Simon Willison 5/30/2026

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

Read Original

This article explores a project that runs Python ASGI web applications entirely in the browser via Pyodide and a service worker. It intercepts same-origin requests under `/app/` and executes them against the Python app using the ASGI protocol, removing the need for a backend server except for static files. The approach is demonstrated with a FastAPI demo and the full Datasette app, showing its generality. The author discusses upgrading Datasette Lite, which previously used Web Workers but had limitations with JavaScript execution. This new method solves those issues, enabling full functionality and plugin support.

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