cd /news/ai-tools/running-python-asgi-apps-in-the-brow… · home topics ai-tools article
[ARTICLE · art-18763] src=simonwillison.net ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

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

Simon Willison successfully ran Python ASGI applications in a web browser using Pyodide and Service Workers, overcoming a four-year limitation in his Datasette Lite project where JavaScript in `<script>` tags would not execute. The new approach, developed with Claude Opus 4.8, enables full Datasette functionality and plugin support in the browser environment. Willison plans to upgrade Datasette Lite to use this Service Worker-based method once he fully understands the implementation.

read1 min views20 publishedMay 30, 2026

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

Datasette Lite is my version of Datasette that runs entirely in the browser using Pyodide in WebAssembly.

When I first built it four years ago I used Web Workers and code that intercepts navigation operations and fetches the generated HTML by running the Python app.

This worked, but had the disadvantage that any JavaScript in <script>

tags would not be executed - breaking some Datasette functionality and a whole lot of Datasette plugins.

This morning I set Claude Opus 4.8 the task (in Claude Code for web) of figuring out how to run Python ASGI apps in Pyodide using Service Workers instead, and it seems to work! Here's a basic ASGI FastCGI demo and here's a demo that runs Datasette 1.0a31.

I'm still getting my head around exactly how it works, but once I've done that I plan to upgrade Datasette Lite itself.

Tags: javascript, python, datasette, asgi, service-workers, pyodide, datasette-lite, claude-code

── more in #ai-tools 4 stories · sorted by recency
── more on @pyodide 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/running-python-asgi-…] indexed:0 read:1min 2026-05-30 ·