{"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-620095649", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 620095649, "node_id": "MDEyOklzc3VlQ29tbWVudDYyMDA5NTY0OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-27T16:32:44Z", "updated_at": "2020-04-27T16:32:44Z", "author_association": "OWNER", "body": "Documentation: https://datasette.readthedocs.io/en/latest/config.html#configuration-directory-mode", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 1, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-619621388", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 619621388, "node_id": "MDEyOklzc3VlQ29tbWVudDYxOTYyMTM4OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-26T20:38:09Z", "updated_at": "2020-04-26T20:38:30Z", "author_association": "OWNER", "body": "Work now happening in the pull request: https://github.com/simonw/datasette/issues/739", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-619611417", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 619611417, "node_id": "MDEyOklzc3VlQ29tbWVudDYxOTYxMTQxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-26T19:28:12Z", "updated_at": "2020-04-26T19:28:12Z", "author_association": "OWNER", "body": "I've shipped #648 now, so no reason not to go with the `static/` folder as the thing that gets detected and mounted as `/static`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-618772317", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 618772317, "node_id": "MDEyOklzc3VlQ29tbWVudDYxODc3MjMxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-24T02:49:46Z", "updated_at": "2020-04-24T02:49:46Z", "author_association": "OWNER", "body": "Yeah I'll do that. My original thinking on allowing the `--static` option to mount other things to the root is that it would make it easy for people to add HTML \"pages\" to their site - like https://www.niche-museums.com/map for example.\r\n\r\nBut I've proposed a better solution for that here: #648", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-618758326", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 618758326, "node_id": "MDEyOklzc3VlQ29tbWVudDYxODc1ODMyNg==", "user": {"value": 25778, "label": "eyeseast"}, "created_at": "2020-04-24T01:55:00Z", "updated_at": "2020-04-24T01:55:00Z", "author_association": "CONTRIBUTOR", "body": "Mounting `./static` at `/static` seems the simplest way. Saves you the trouble of deciding what else (`img` for example) gets special treatment.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-618155472", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 618155472, "node_id": "MDEyOklzc3VlQ29tbWVudDYxODE1NTQ3Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-23T03:28:42Z", "updated_at": "2020-04-23T03:28:56Z", "author_association": "OWNER", "body": "As an alternative to `--static` this could work by letting you create the following:\r\n\r\n- `static/css/`\r\n- `static/js/`\r\n\r\nWhich would be automatically mounted at `/js/...` and `/css/...`\r\n\r\nOr maybe just mount `static/` at `/static/` instead? ", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-618126449", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 618126449, "node_id": "MDEyOklzc3VlQ29tbWVudDYxODEyNjQ0OQ==", "user": {"value": 25778, "label": "eyeseast"}, "created_at": "2020-04-23T01:38:55Z", "updated_at": "2020-04-23T01:38:55Z", "author_association": "CONTRIBUTOR", "body": "I've almost suggested this same thing a couple times. I tend to have Makefile (because I'm doing other `make` stuff anyway to get data prepped), and I end up putting all those CLI options in something like `make run`. But it would be way easier to just have all those typical options -- plugins, templates, metadata -- be defaults.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-618070791", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 618070791, "node_id": "MDEyOklzc3VlQ29tbWVudDYxODA3MDc5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-22T22:21:27Z", "updated_at": "2020-04-22T22:21:27Z", "author_association": "OWNER", "body": "I linked to this from https://github.com/zeit/now/discussions/4055", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/731#issuecomment-618070541", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/731", "id": 618070541, "node_id": "MDEyOklzc3VlQ29tbWVudDYxODA3MDU0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-22T22:20:38Z", "updated_at": "2020-04-22T22:20:38Z", "author_association": "OWNER", "body": "I started thinking about this while building https://github.com/simonw/datasette-publish-now\r\n\r\nThe Vercel hosting platform is built on ASGI - so I need a way to provide an `app` ASGI object for it to use rather than Datasette's normal pattern of starting up the server using the `datasette serve` command.\r\n\r\nThe plugin currently does that by generating an `index.py` file that looks like this:\r\n\r\n```python\r\nfrom datasette.app import Datasette\r\nimport json\r\nmetadata = dict()\r\ntry:\r\n metadata = json.load(open(\"metadata.json\"))\r\nexcept Exception:\r\n pass\r\napp = Datasette([], [\"fixtures.db\"], metadata=metadata).app()\r\n```\r\nBut that means I have to replicate the different CLI options - `--plugins-dir` etc - and figure out how to pass them to the `Datasette()` constructor.\r\n\r\nThis would be a whole lot easier if I could use `app = Datasette(configure_directory=\".\")` and provide a magically configured instance based on the presence of files in the specified directory.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 605110015, "label": "Option to automatically configure based on directory layout"}, "performed_via_github_app": null}