mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_trace=1 now depends on trace_debug setting, closes #1359
This commit is contained in:
parent
368aa5f1b1
commit
ff29dd55fa
7 changed files with 69 additions and 26 deletions
|
|
@ -162,6 +162,11 @@ SETTINGS = (
|
|||
False,
|
||||
"Allow display of template debug information with ?_context=1",
|
||||
),
|
||||
Setting(
|
||||
"trace_debug",
|
||||
False,
|
||||
"Allow display of SQL trace debug information with ?_trace=1",
|
||||
),
|
||||
Setting("base_url", "/", "Datasette URLs should use this base path"),
|
||||
)
|
||||
|
||||
|
|
@ -1041,14 +1046,15 @@ class Datasette:
|
|||
if not database.is_mutable:
|
||||
await database.table_counts(limit=60 * 60 * 1000)
|
||||
|
||||
asgi = asgi_csrf.asgi_csrf(
|
||||
DatasetteRouter(self, routes),
|
||||
signing_secret=self._secret,
|
||||
cookie_name="ds_csrftoken",
|
||||
)
|
||||
if self.setting("trace_debug"):
|
||||
asgi = AsgiTracer(asgi)
|
||||
asgi = AsgiLifespan(
|
||||
AsgiTracer(
|
||||
asgi_csrf.asgi_csrf(
|
||||
DatasetteRouter(self, routes),
|
||||
signing_secret=self._secret,
|
||||
cookie_name="ds_csrftoken",
|
||||
)
|
||||
),
|
||||
asgi,
|
||||
on_startup=setup_db,
|
||||
)
|
||||
for wrapper in pm.hook.asgi_wrapper(datasette=self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue