Skip to content

fixed pages windows bug #2092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
### Fixed
- [#2084](https://github.com/plotly/dash/pull/2084) In dash 2.5.0, a default viewport meta tag was added as recommended for mobile-optimized sites by [mdn](https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag)
This feature can be disabled by providing an empty viewport meta tag. e.g. `app = Dash(meta_tags=[{"name": "viewport"}])`
- [#2090](https://github.com/plotly/dash/pull/2090), [#2092](https://github.com/plotly/dash/pull/2092). Fixed bug where the `path` to the `pages_folder` was incorrect on Windows.

## [2.5.0] - 2022-06-07

Expand Down
2 changes: 1 addition & 1 deletion dash/_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _module_name_to_page_name(filename):
def _infer_path(filename, template):
if template is None:
if CONFIG.pages_folder:
pages_folder = CONFIG.pages_folder.split("/")[-1]
pages_folder = CONFIG.pages_folder.replace("\\", "/").split("/")[-1]
path = (
filename.replace("_", "-")
.replace(".", "/")
Expand Down
4 changes: 3 additions & 1 deletion dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2171,7 +2171,9 @@ def _import_layouts_from_pages(self):
continue

page_filename = os.path.join(root, file).replace("\\", "/")
_, _, page_filename = page_filename.partition(walk_dir.replace("\\", "/") + "/")
_, _, page_filename = page_filename.partition(
walk_dir.replace("\\", "/") + "/"
)
page_filename = page_filename.replace(".py", "").replace("/", ".")

pages_folder = (
Expand Down