{"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-641002504", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 641002504, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MTAwMjUwNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-09T03:14:32Z", "updated_at": "2020-06-09T03:14:32Z", "author_association": "OWNER", "body": "Documentation: https://datasette.readthedocs.io/en/latest/plugins.html#register-routes", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640972952", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640972952, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDk3Mjk1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-09T01:24:52Z", "updated_at": "2020-06-09T01:25:33Z", "author_association": "OWNER", "body": "WIP documentation: https://github.com/simonw/datasette/blob/770dedb21adfc706592e6b5cdf5e751a8720fdf9/docs/plugins.rst#register_routes", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640971470", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640971470, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDk3MTQ3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-09T01:19:44Z", "updated_at": "2020-06-09T01:19:44Z", "author_association": "OWNER", "body": "I'll need to add documentation of the `Response` object (and `Response.html()` and `Response.text()` class methods - I should add `Response.json()` too) to the internals page https://datasette.readthedocs.io/en/stable/internals.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640960667", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640960667, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDk2MDY2Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-09T00:41:35Z", "updated_at": "2020-06-09T00:41:35Z", "author_association": "OWNER", "body": "I'm going to implement this one documentation-first in a pull request.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640960553", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640960553, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDk2MDU1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-09T00:41:09Z", "updated_at": "2020-06-09T00:41:09Z", "author_association": "OWNER", "body": "I'm going to imitate `register_output_renderer` and `register_facet_classes` - both return a list of things to register.\r\n\r\nSo I'll do this:\r\n\r\n```python\r\n@hookspec\r\ndef register_routes():\r\n \"Register URL routes. Return a list of (regex, view_function) pairs\"\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640121917", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640121917, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDEyMTkxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-06T21:42:58Z", "updated_at": "2020-06-07T05:58:36Z", "author_association": "OWNER", "body": "I might use some dependency injection here, with `call_with_supported_arguments()` from https://github.com/simonw/datasette/commit/41a0cd7b6afe0397efbbf27ad822679fc574811a#diff-942305c83055fdc0ff5f4e7d6ab06b29\r\n\r\nMaybe a view function can take `request` and optionally also take `datasette`? Or `scope` or `receive` or `send`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-504881900", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 504881900, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNDg4MTkwMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-06-24T06:51:29Z", "updated_at": "2020-06-06T21:47:11Z", "author_association": "OWNER", "body": "See also #520 - asgi_wrapper plugin hook.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-398826108", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 398826108, "node_id": "MDEyOklzc3VlQ29tbWVudDM5ODgyNjEwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-20T17:09:18Z", "updated_at": "2020-06-06T21:46:51Z", "author_association": "OWNER", "body": "This depends on #272 - Datasette ported to ASGI.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640122120", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640122120, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDEyMjEyMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-06T21:45:13Z", "updated_at": "2020-06-06T21:45:52Z", "author_association": "OWNER", "body": "Stretch goal: make it easy for plugin views to implement formats, so they can produce HTML by default and .json or .csv etc as alternative outputs.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640121036", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640121036, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDEyMTAzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-06T21:34:03Z", "updated_at": "2020-06-06T21:34:03Z", "author_association": "OWNER", "body": "I'll refactor existing code to register views using the same mechanism that plugins will have access to.\r\n\r\nMaybe plugins get to register their routes first? That would allow plugins to do things like entirely take over the / page.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640119259", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640119259, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDExOTI1OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-06T21:16:46Z", "updated_at": "2020-06-06T21:16:46Z", "author_association": "OWNER", "body": "I deprioritised this a while ago because the asgi_wrapper hook allowed me to set up new URL routes: https://datasette.readthedocs.io/en/0.43/plugins.html#asgi-wrapper-datasette\r\n\r\nBut... those were pretty low level, for example this code here: https://github.com/simonw/datasette-auth-github/blob/6c971064f6f4e6857bade5c6b88842f9cdeca9d9/datasette_auth_github/github_auth.py#L104-L113\r\n\r\nNow that Datasette has a documented request object #706 and that object is used by things like the flash messages system (#790) - https://datasette.readthedocs.io/en/latest/internals.html#add-message-request-message-message-type-datasette-info - I find myself wanting to add views which get a request, as opposed to an ASGI scope.\r\n\r\nSo I'm re-prioritising this, with the main need being a way for plugins to hook up their own view functions that can accept a request and return a response. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-640118802", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 640118802, "node_id": "MDEyOklzc3VlQ29tbWVudDY0MDExODgwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-06-06T21:12:41Z", "updated_at": "2020-06-06T21:12:41Z", "author_association": "OWNER", "body": "@clausjuhl your use-case there is now covered by custom pages from Datasette 0.41 https://datasette.readthedocs.io/en/stable/changelog.html#v0-41", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-540548765", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 540548765, "node_id": "MDEyOklzc3VlQ29tbWVudDU0MDU0ODc2NQ==", "user": {"value": 2181410, "label": "clausjuhl"}, "created_at": "2019-10-10T12:27:56Z", "updated_at": "2019-10-10T12:27:56Z", "author_association": "NONE", "body": "Hi Simon. Any news on the ability to add routes (with static content) to datasette? As a public institution I'm required to have at least privacy, cookie and availability policies in place, and it really would be nice to have these under the same url. Thank you for some great work!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/215#issuecomment-507929913", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/215", "id": 507929913, "node_id": "MDEyOklzc3VlQ29tbWVudDUwNzkyOTkxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-07-03T04:08:28Z", "updated_at": "2019-07-03T04:08:28Z", "author_association": "OWNER", "body": "I just closed #520 which means this is now technically possible.\r\n\r\nBut... doing it using the new `asgi_wrapper` hook https://datasette.readthedocs.io/en/latest/plugins.html#asgi-wrapper-datasette isn't particularly obvious.\r\n\r\nI'm going to leave this ticket open for the moment. I think I need at least one example plugin to show that this approach is good enough - and it's still quite possible that I'll add an extra, easier hook for this. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506669, "label": "Allow plugins to define additional URL routes and views"}, "performed_via_github_app": null}