Skip to content

Fix Pages not_found_404 parsing #2100

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 5 commits into from
Jul 11, 2022
Merged
Changes from 1 commit
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
Next Next commit
Fix bug on no pages directory 404 path parsing
When initializing the Dash object using `use_pages=True` and `pages_folder=""` you cannot pass a `dash.register_page("not_found_404", layout=CUSTOM_404_LAYOUT)`. Line 2245 joins on a pages_folder and 404 path making the searched module name ".not_found_404". This small edit fixes the error and allows for passing a 404 page using module name "not_found_404" in the case of pages_folder="".
  • Loading branch information
jacobswe authored Jun 19, 2022
commit caa4f3adfba7975caa0af66f0fda8345ed2923c4
2 changes: 1 addition & 1 deletion dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@ def update(pathname, search):

# get layout
if page == {}:
module_404 = ".".join([self.pages_folder, "not_found_404"])
module_404 = ".".join([self.pages_folder, "not_found_404"]) if self.pages_folder else "not_found_404"
not_found_404 = _pages.PAGE_REGISTRY.get(module_404)
if not_found_404:
layout = not_found_404["layout"]
Expand Down