Datasette
raw JSON → 0.65.2 verified Mon Apr 27 auth: no python
An open source multi-tool for exploring and publishing data, providing a web interface to SQLite databases. Current version 0.65.2, released regularly.
pip install datasette Common errors
error ModuleNotFoundError: No module named 'asyncio' ↓
cause Trying to import 'asyncio' which is a built-in module; error occurs if Python is too old (pre-3.3).
fix
Upgrade to Python 3.9+ as required by datasette; asyncio is part of the standard library.
error datasette.exceptions.Error: No such table: ... ↓
cause Database file does not contain the expected table, or the file path is incorrect.
fix
Verify the database file exists and contains the correct tables using
sqlite3 my.db .tables. Warnings
breaking In version 0.63, the `datasette publish cloudrun` command was removed. Use `datasette cloudrun` or `datasette publish fly` instead. ↓
fix Use `datasette cloudrun` or consider using `datasette publish fly` for deployment.
deprecated The `--config` CLI flag is deprecated. Use `-c` or `--settings` in newer versions. ↓
fix Replace `--config myconfig.json` with `-c myconfig.json` or use `--settings`.
gotcha Datasette uses asyncio; calling blocking functions will hang the server. Ensure all custom plugins and hooks are async. ↓
fix Define custom render functions and hooks as async functions (e.g., `async def render_custom(request, datasette)`).
Imports
- datasette
import datasette
Quickstart
import datasette
import asyncio
async def quickstart():
app = datasette.Datasette(files=["my_database.db"])
await app.serve()
asyncio.run(quickstart())