html_url,issue_url,id,node_id,user,user_label,created_at,updated_at,author_association,body,reactions,issue,issue_label,performed_via_github_app https://github.com/simonw/datasette/issues/1238#issuecomment-790857004,https://api.github.com/repos/simonw/datasette/issues/1238,790857004,MDEyOklzc3VlQ29tbWVudDc5MDg1NzAwNA==,79913,tsibley,2021-03-04T19:06:55Z,2021-03-04T19:06:55Z,NONE,"@rgieseke Ah, that's super helpful. Thank you for the workaround for now!","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",813899472,Custom pages don't work with base_url setting, https://github.com/simonw/datasette/issues/1238#issuecomment-789186458,https://api.github.com/repos/simonw/datasette/issues/1238,789186458,MDEyOklzc3VlQ29tbWVudDc4OTE4NjQ1OA==,198537,rgieseke,2021-03-02T20:19:30Z,2021-03-02T20:19:30Z,CONTRIBUTOR,A custom `templates/index.html` seems to work and custom `pages` as a workaround with moving them to `pages/base_url_dir`.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",813899472,Custom pages don't work with base_url setting, https://github.com/simonw/datasette/issues/1238#issuecomment-786849095,https://api.github.com/repos/simonw/datasette/issues/1238,786849095,MDEyOklzc3VlQ29tbWVudDc4Njg0OTA5NQ==,9599,simonw,2021-02-26T19:29:38Z,2021-02-26T19:29:38Z,OWNER,"Here's the test I wrote: ```diff git diff tests/test_custom_pages.py diff --git a/tests/test_custom_pages.py b/tests/test_custom_pages.py index 6a23192..5a71f56 100644 --- a/tests/test_custom_pages.py +++ b/tests/test_custom_pages.py @@ -2,11 +2,19 @@ import pathlib import pytest from .fixtures import make_app_client +TEST_TEMPLATE_DIRS = str(pathlib.Path(__file__).parent / ""test_templates"") + @pytest.fixture(scope=""session"") def custom_pages_client(): + with make_app_client(template_dir=TEST_TEMPLATE_DIRS) as client: + yield client + + +@pytest.fixture(scope=""session"") +def custom_pages_client_with_base_url(): with make_app_client( - template_dir=str(pathlib.Path(__file__).parent / ""test_templates"") + template_dir=TEST_TEMPLATE_DIRS, config={""base_url"": ""/prefix/""} ) as client: yield client @@ -23,6 +31,12 @@ def test_request_is_available(custom_pages_client): assert ""path:/request"" == response.text +def test_custom_pages_with_base_url(custom_pages_client_with_base_url): + response = custom_pages_client_with_base_url.get(""/prefix/request"") + assert 200 == response.status + assert ""path:/prefix/request"" == response.text + + def test_custom_pages_nested(custom_pages_client): response = custom_pages_client.get(""/nested/nest"") assert 200 == response.status ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",813899472,Custom pages don't work with base_url setting, https://github.com/simonw/datasette/issues/1238#issuecomment-786848654,https://api.github.com/repos/simonw/datasette/issues/1238,786848654,MDEyOklzc3VlQ29tbWVudDc4Njg0ODY1NA==,9599,simonw,2021-02-26T19:28:48Z,2021-02-26T19:28:48Z,OWNER,"I added a debug line just before `for regex, wildcard_template` here: https://github.com/simonw/datasette/blob/afed51b1e36cf275c39e71c7cb262d6c5bdbaa31/datasette/app.py#L1148-L1155 And it showed that for some reason `request.path` is `/prefix/prefix/request` here - the prefix got doubled somehow.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",813899472,Custom pages don't work with base_url setting, https://github.com/simonw/datasette/issues/1238#issuecomment-786841261,https://api.github.com/repos/simonw/datasette/issues/1238,786841261,MDEyOklzc3VlQ29tbWVudDc4Njg0MTI2MQ==,9599,simonw,2021-02-26T19:13:44Z,2021-02-26T19:13:44Z,OWNER,Sounds like a bug - thanks for reporting this.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",813899472,Custom pages don't work with base_url setting,