Julien :ve: 🔭:python:<p>TIL: Plotly Dash uses the order of the pages in the pages registry to evaluate whether the requested URL matches a page's `path_template` value. By default, pages are ordered alphabetically based on the pages filename.</p><p>In my case, I had two pages defined with the following `path_template` values:<br>- `/datasets/<dataset_id>` in `pages/dataset.py`<br>- `/datasets/<dataset_id>/labelsets/<labelset_id>` in `pages/labelset.py`</p><p>When trying to open a URL matching the second template, it was matching the first one and using the remainder of the URL as `dataset_id`.</p><p>Setting the `order` parameter in the `dash.register_page()` function changes the order of the pages in the page registry, thus changing the path matching order. To match the longest/nested `path_template`, the corresponding page has to be registered with a lower `order` value.</p><p>That makes sense in hindsight but the docs do not mention that the path evaluation is affected by the page order.</p><p><a href="https://dash.plotly.com/urls" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">dash.plotly.com/urls</span><span class="invisible"></span></a></p><p><a href="https://techhub.social/tags/Plotly" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Plotly</span></a> <a href="https://techhub.social/tags/PlotlyDash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PlotlyDash</span></a> <a href="https://techhub.social/tags/Dash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Dash</span></a> <a href="https://techhub.social/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> <a href="https://techhub.social/tags/WebDev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>WebDev</span></a></p>