Running Datasette on Replit

I figured out how to run Datasette on

The trick is to start a new Python project and then drop the following into the file:

import uvicorn
from import Datasette

ds = Datasette(memory=True, files=[])

if __name__ == "__main__":, host="", port=8000)

Replit is smart enough to automatically create a pyproject.toml file with datasette and uvicorn as dependencies. It will also notice that the application is running on port 8000 and set to proxy to that port. Plus it will restart the server any time it recieves new traffic (and pause it in between groups of requests).

To serve a database file, download it using wget in the Replit console and add it to the files=[] argument. I ran this:


Then changed that first line to:

ds = Datasette(files=["content.db"])

And restarted the server.

Created 2021-05-02T11:50:05-07:00 · Edit