mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
datasette.urls methods will not apply base_url prefix twice, refs #1026
This commit is contained in:
parent
c1d386ef67
commit
7a67bc7a56
4 changed files with 70 additions and 17 deletions
|
|
@ -443,6 +443,8 @@ These functions can be accessed via the ``{{ urls }}`` object in Datasette templ
|
|||
|
||||
Use the ``format="json"`` (or ``"csv"`` or other formats supported by plugins) arguments to get back URLs to the JSON representation. This is usually the path with ``.json`` added on the end, but it may use ``?_format=json`` in cases where the path already includes ``.json``, for example a URL to a table named ``table.json``.
|
||||
|
||||
These methods each return a ``datasette.utils.PrefixedUrlString`` object, which is a subclass of the Python ``str`` type. This allows the logic that considers the ``base_url`` setting to detect if that prefix has already been applied to the path.
|
||||
|
||||
.. _internals_database:
|
||||
|
||||
Database class
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue