Set "pages_folder" to an absolute path

The pages_folder keyword argument of the Dash object seems to support only relative paths, but I would like to use an absolute path. Is there any particular reasoning behind this limitation and/or any known work arounds? Maybe @AnnMarieW knows? :slight_smile:

Hi @Emil

It works the same as declaring the assets_folder. Originally, you were required to use absolute path, then it was changed to a relative path as of dash 0.35.3. Here’s some background: Changing the name parameter to required. · Issue #399 · plotly/dash · GitHub

3 Likes

Hi @Emil

I got the same issue. I tried to navigate upstream with “…/…/…/…/my/pages/folder” but it did not work. Did you find a workaround ? Thanks !

Hey folks, I had a look into this and it looks like assets_folder does actually allow an absolute path (though this is not documented). From my experiments, I don’t see any reason why pages_folder couldn’t be made to work similarly. I’ve been chatting to @AnnMarieW about this, and I’m going to work on a PR. Hopefully will have something to report back with soon.

4 Likes

OK I have a PR together here: Dash Pages pages_folder bug fixes and enhancements by ned2 · Pull Request #2392 · plotly/dash · GitHub

There ended up being a few other issues and related enhancements to the pages_folder behaviour, so it took a bit longer to put together. Let’s see what the feedback from Dash maintainers is.

3 Likes

Happy to say that the above PR was merged and made it into Dash’s 2.9.0 release.

2 Likes