mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Link to Datasette API docs from /-/api, refs #1871
This commit is contained in:
parent
042881a522
commit
000eeb4464
3 changed files with 8 additions and 9 deletions
|
|
@ -1100,6 +1100,7 @@ class Datasette:
|
|||
),
|
||||
"base_url": self.setting("base_url"),
|
||||
"csrftoken": request.scope["csrftoken"] if request else lambda: "",
|
||||
"datasette_version": __version__,
|
||||
},
|
||||
**extra_template_vars,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,14 +10,13 @@
|
|||
|
||||
<h1>API Explorer</h1>
|
||||
|
||||
<p>Use this tool to try out the Datasette write API.</p>
|
||||
|
||||
{% if errors %}
|
||||
{% for error in errors %}
|
||||
<p class="message-error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<p>Use this tool to try out the
|
||||
{% if datasette_version %}
|
||||
<a href="https://docs.datasette.io/en/{{ datasette_version }}/json_api.html">Datasette API</a>.
|
||||
{% else %}
|
||||
Datasette API.
|
||||
{% endif %}
|
||||
</p>
|
||||
<details open style="border: 2px solid #ccc; border-bottom: none; padding: 0.5em">
|
||||
<summary style="cursor: pointer;">GET</summary>
|
||||
<form method="get" id="api-explorer-get" style="margin-top: 0.7em">
|
||||
|
|
|
|||
|
|
@ -507,7 +507,6 @@ class DataView(BaseView):
|
|||
if key not in ("_labels", "_facet", "_size")
|
||||
]
|
||||
+ [("_size", "max")],
|
||||
"datasette_version": __version__,
|
||||
"settings": self.ds.settings_dict(),
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue