Wykres commitów

406 Commity (1d64c9a8dac45b9a3452acf8e76dfadea2b0bc49)

Autor SHA1 Wiadomość Data
Alex Garcia 1d64c9a8da
Add new entrypoint option to --load-extensions. (#1789)
Thanks, @asg017
2022-08-23 11:34:30 -07:00
Chris Amico 01369176b0
Keep track of datasette.config_dir (#1766)
Thanks, @eyeseast - closes #1764
2022-07-17 18:12:45 -07:00
Simon Willison c09c53f345 New handle_exception plugin hook, refs #1770
Also refs:
- https://github.com/simonw/datasette-sentry/issues/1
- https://github.com/simonw/datasette-show-errors/issues/2
2022-07-17 16:24:39 -07:00
Simon Willison 8188f55efc Rename handle_500 to handle_exception, refs #1770 2022-07-17 15:24:16 -07:00
Simon Willison 3508bf7875 --nolock mode to ignore locked files, closes #1744 2022-05-17 12:40:25 -07:00
Simon Willison 3f00a29141
Clean up compatibility with Pyodide (#1736)
* Optional uvicorn import for Pyodide, refs #1733
* --setting num_sql_threads 0 to disable threading, refs #1735
2022-05-02 13:15:27 -07:00
Simon Willison 7e03394734 Optional uvicorn import for Pyodide, refs #1733 2022-05-02 12:20:14 -07:00
Simon Willison 579f59dcec Refactor to remove RowTableShared class, closes #1719
Refs #1715
2022-04-25 11:33:35 -07:00
Simon Willison 1a7750eb29 Documented datasette.check_visibility() method, closes #1678 2022-03-21 12:01:37 -07:00
Simon Willison 194e4f6c3f Removed check_permission() from BaseView, closes #1677
Refs #1660
2022-03-21 11:41:56 -07:00
Simon Willison e627510b76 BaseView.check_permissions is now datasette.ensure_permissions, closes #1675
Refs #1660
2022-03-21 10:13:16 -07:00
Simon Willison 7a6654a253 Databases can now have a .route separate from their .name, refs #1668 2022-03-19 17:11:17 -07:00
Simon Willison b9c2b1cfc8 Consistent treatment of format in route capturing, refs #1667
Also refs #1660
2022-03-19 13:29:10 -07:00
Simon Willison 61419388c1 Rename route match groups for consistency, refs #1667, #1660 2022-03-19 09:52:08 -07:00
Simon Willison 711767bcd3 Refactored URL routing to add tests, closes #1666
Refs #1660
2022-03-18 21:03:08 -07:00
Simon Willison 9979dcd07f Also remove default_cache_ttl_hashed setting, refs #1661 2022-03-18 17:25:14 -07:00
Simon Willison 8658c66438 Show error if --setting hash_urls 1 used, refs #1661 2022-03-18 17:19:31 -07:00
Simon Willison d4f60c2388
Remove hashed URL mode
Also simplified how view class routing works.

Refs #1661
2022-03-18 17:12:03 -07:00
Simon Willison a35393b29c
Tilde encoding (#1659)
Closes #1657

Refs #1439
2022-03-15 11:01:57 -07:00
Simon Willison 020effe47b Preserve query string in % to - redirects, refs #1650 2022-03-07 08:18:07 -08:00
Simon Willison 644d25d1de Redirect old % URLs to new - encoded URLs, closes #1650
Refs #1439
2022-03-07 08:01:42 -08:00
Simon Willison 458f03ad3a More SpatiaLite details on /-/versions, closes #1607 2022-02-08 22:32:19 -08:00
Robert Christie 1af1041f91
Jinja template_name should use "/" even on Windows (#1617)
Closes #1545. Thanks, Robert Christie
2022-02-02 17:58:35 -08:00
Simon Willison b2eebf5ebf No need to send this, it's got a default, refs #1603 2022-01-19 21:52:00 -08:00
Simon Willison 0467723ee5 New, improved favicon - refs #1603 2022-01-19 21:46:03 -08:00
Simon Willison e1770766ce Return plugins and hooks in predictable order 2022-01-19 21:14:04 -08:00
Simon Willison 43c30ce023 Use cog to maintain default plugin list in plugins.rst, closes #1600
Also fixed a bug I spotted where datasette.filters showed the same hook three times.
2022-01-19 21:04:09 -08:00
Simon Willison 8c401ee0f0 Fixed remaining code and docs for new block=True default, closes #1579 2021-12-23 11:18:20 -08:00
Simon Willison 359140ceda Datasette() constructor no longer requires files=, closes #1563 2021-12-17 18:09:00 -08:00
Simon Willison c35b84a2aa Remove undocumented sqlite_functions mechanism, closes #1567 2021-12-17 17:54:39 -08:00
Simon Willison f000a7bd75
Use load_extension(?) instead of fstring 2021-12-17 12:15:29 -08:00
Simon Willison 3025505515 functools.wraps to help investigate #1517 2021-11-18 19:19:43 -08:00
Simon Willison 8584993529 --cors Access-Control-Allow-Headers: Authorization
Refs #1467, refs https://github.com/simonw/datasette-auth-tokens/issues/4
2021-10-14 12:03:28 -07:00
Simon Willison b267b57754
Upgrade to httpx 0.20
* Upgrade to httpx 0.20, closes #1488
* TestClient.post() should not default to following redirects
2021-10-14 11:03:44 -07:00
Simon Willison 2883098770 Fixed config_dir mode, refs #1432 2021-08-12 22:17:40 -07:00
Simon Willison bbc4756f9e
Settings fix, refs #1433 2021-08-12 20:54:25 -07:00
Simon Willison ca4f83dc7b Rename config= to settings=, refs #1432 2021-08-12 18:10:36 -07:00
Simon Willison a21853c9da Fix for rich.console sometimes not being available, refs #1416 2021-08-06 22:17:36 -07:00
Simon Willison 54b6e96ee8 Use optional rich dependency to render tracebacks, closes #1416 2021-08-03 09:12:48 -07:00
Simon Willison eccfeb0871 register_routes() plugin hook datasette argument, closes #1404 2021-07-26 16:16:46 -07:00
Simon Willison c00f29affc
Fix for race condition in refresh_schemas(), closes #1231 2021-07-16 12:44:58 -07:00
Simon Willison dd5ee8e668 Removed some unused imports
I found these with:

    flake8 datasette | grep unus
2021-07-15 23:26:12 -07:00
Simon Willison ea627baccf Removed fallback parameter from get_metadata, refs #1384 2021-06-26 17:02:42 -07:00
Brandon Roberts baf986c871
New get_metadata() plugin hook for dynamic metadata
The following hook is added:

    get_metadata(
      datasette=self, key=key, database=database, table=table,
      fallback=fallback
    )

This gets called when we're building our metdata for the rest
of the system to use. We merge whatever the plugins return
with any local metadata (from metadata.yml/yaml/json) allowing
for a live-editable dynamic Datasette.

As a security precation, local meta is *not* overwritable by
plugin hooks. The workflow for transitioning to live-meta would
be to load the plugin with the full metadata.yaml and save.
Then remove the parts of the metadata that you want to be able
to change from the file.

* Avoid race condition: don't mutate databases list

This avoids the nasty "RuntimeError: OrderedDict mutated during
iteration" error that randomly happens when a plugin adds a
new database to Datasette, using `add_database`. This change
makes the add and remove database functions more expensive, but
it prevents the random explosion race conditions that make for
confusing user experience when importing live databases.

Thanks, @brandonrobertz
2021-06-26 15:24:54 -07:00
Simon Willison b1fd24ac9f skip_csrf(datasette, scope) plugin hook, refs #1377 2021-06-23 15:40:09 -07:00
Chris Amico a6c55afe8c
Ensure db.path is a string before trying to insert into internal database (#1370)
Thanks, @eyeseast
2021-06-21 08:57:38 -07:00
Simon Willison d23a267138 Make request available to menu plugin hooks, closes #1371 2021-06-09 21:45:24 -07:00
Simon Willison ff29dd55fa ?_trace=1 now depends on trace_debug setting, closes #1359 2021-06-05 13:18:37 -07:00
Simon Willison a634121525
Make custom pages compatible with base_url setting
Closes #1238

- base_url no longer causes custom page routing to fail
- new route_path key in request.scope storing the path that was used for routing with the base_url prefix stripped
- TestClient used by tests now avoids accidentally double processing of the base_url prefix
2021-06-05 11:59:54 -07:00
Simon Willison 807de378d0 /-/databases and homepage maintain connection order, closes #1216 2021-06-01 20:10:15 -07:00