mirror of
https://github.com/simonw/datasette.git
synced 2026-05-30 13:46:59 +02:00
It is now possible to over-ride templates on a per-database / per-row or per-
table basis.
When you access e.g. /mydatabase/mytable Datasette will look for the following:
- table-mydatabase-mytable.html
- table.html
If you provided a --template-dir argument to datasette serve it will look in
that directory first.
The lookup rules are as follows:
Index page (/):
index.html
Database page (/mydatabase):
database-mydatabase.html
database.html
Table page (/mydatabase/mytable):
table-mydatabase-mytable.html
table.html
Row page (/mydatabase/mytable/id):
row-mydatabase-mytable.html
row.html
If a table name has spaces or other unexpected characters in it, the template
filename will follow the same rules as our custom <body> CSS classes
introduced in
|
||
|---|---|---|
| .. | ||
| static | ||
| templates | ||
| __init__.py | ||
| app.py | ||
| cli.py | ||
| utils.py | ||
| version.py | ||