{"html_url": "https://github.com/simonw/datasette/issues/272#issuecomment-494297022", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/272", "id": 494297022, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NDI5NzAyMg==", "user": {"value": 647359, "label": "tomchristie"}, "created_at": "2019-05-21T08:39:17Z", "updated_at": "2019-05-21T08:39:17Z", "author_association": "NONE", "body": "Useful context stuff:\r\n\r\n> ASGI decodes %2F encoded slashes in URLs automatically\r\n\r\n`raw_path` for ASGI looks to be under consideration: https://github.com/django/asgiref/issues/87\r\n\r\n> uvicorn doesn't support Python 3.5\r\n\r\nThat was an issue specifically against the <=3.5.2 minor point releases of Python, now resolved: https://github.com/encode/uvicorn/issues/330 \ud83d\udc4d\r\n\r\n> Starlette for things like form parsing - but it's 3.6+ only!\r\n\r\nYeah - the bits that require 3.6 are anywhere with the \"async for\" syntax. If it wasn't for that I'd downport it, but that one's a pain. It's the one bit of syntax to watch out for if you're looking to bring any bits of implementation across to Datasette.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 324188953, "label": "Port Datasette to ASGI"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/272#issuecomment-494192779", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/272", "id": 494192779, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NDE5Mjc3OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-21T00:10:47Z", "updated_at": "2019-05-21T00:10:47Z", "author_association": "OWNER", "body": "https://github.com/simonw/datasette/commit/9fdb47ca952b93b7b60adddb965ea6642b1ff523 added `decode_path_component()` and `encode_path_component()` functions because ASGI decodes %2F encoded slashes in URLs automatically. The new encoding scheme looks like this:\r\n\r\n \"table/and/slashes\" => \"tableU+002FandU+002Fslashes\"\r\n \"~table\" => \"U+007Etable\"\r\n \"+bobcats!\" => \"U+002Bbobcats!\"\r\n \"U+007Etable\" => \"UU+002B007Etable\"\r\n\r\nFor background see this comment: https://github.com/django/asgiref/issues/51#issuecomment-450603464", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 324188953, "label": "Port Datasette to ASGI"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/272#issuecomment-494192163", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/272", "id": 494192163, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NDE5MjE2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-21T00:07:25Z", "updated_at": "2019-05-21T00:07:25Z", "author_association": "OWNER", "body": "Bah, I'd much rather depend on Starlette for things like form parsing - but it's 3.6+ only!\r\n\r\nhttps://github.com/encode/starlette/blob/ab86530eddfcf56e0f7e5ca56f6ab69c15594a7d/setup.py#L39\r\n\r\nMaybe I could require Python 3.6 or higher if you want to handle POST data? This would make my internals far too complicated though I think.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 324188953, "label": "Port Datasette to ASGI"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/272#issuecomment-494191738", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/272", "id": 494191738, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NDE5MTczOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-21T00:05:02Z", "updated_at": "2019-05-21T00:05:02Z", "author_association": "OWNER", "body": "While I'm not depending on Starlette any more I will need to instead depend on https://github.com/andrew-d/python-multipart for POST form parsing - as used by Starlette here https://github.com/encode/starlette/blob/ab86530eddfcf56e0f7e5ca56f6ab69c15594a7d/starlette/requests.py#L178-L193", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 324188953, "label": "Port Datasette to ASGI"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/272#issuecomment-494191378", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/272", "id": 494191378, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NDE5MTM3OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-21T00:02:48Z", "updated_at": "2019-05-21T00:02:48Z", "author_association": "OWNER", "body": "I said earlier that I only need to support GET - I actually need to be able to support POST too, mainly to support plugins (e.g. a plugin that allows authenticated login before you can view Datasette, but potentially also plugins that let you write data directly to SQLite as well).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 324188953, "label": "Port Datasette to ASGI"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/272#issuecomment-494190922", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/272", "id": 494190922, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NDE5MDkyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-21T00:00:40Z", "updated_at": "2019-05-21T00:01:09Z", "author_association": "OWNER", "body": "Wow, this issue has been open for a full year now!\r\n\r\nI've been thinking about this a lot. I've decided I want Datasette to use ASGI 3.0 internally with no dependencies on anything else - then I want the option to run Datasette under both daphne and uvicorn - because uvicorn doesn't support Python 3.5 but Datasette still needs to (primarily for Glitch), and daphne works with 3.5.\r\n\r\nSo I'm going to try to go the following route:\r\n\r\n- Every Datasette view becomes an ASGI app\r\n- The Datasette application itself is an ASGI app that routes to those views\r\n- When you `pip install datasette` you get Daphne as a dependency (I'd like you to be able to opt-out of installing Daphne, I'm not yet sure how that would work)\r\n- A new `asgi_serve` plugin hook allows a plugin to serve Datasette using uvicorn (or hypercorn) instead", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 324188953, "label": "Port Datasette to ASGI"}, "performed_via_github_app": null}