-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix Pages not_found_404 parsing #2100
Conversation
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="".
I have been migrating my app to 3.5 and, in using the new pages plugin, I manually registered pages after doing some set up (hence the page_folder=""). I noticed couldn't pass the not_found_404 and get it to register correctly, but drilling into the source code I found this would fix the issue, and that using ".not_found_404" as the module name was a working alternative. Opening this to offer a solution (if it's not purposeful behavior) or alternatively that this would be good to document (if it is purposeful behavior). |
Yep! Will write this and update PR over the weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 Looks great, thanks @jacobswe and @AnnMarieW!
Thanks for this, I was having dev environment issues and have been traveling for work. |
When initializing the Dash object using
use_pages=True
andpages_folder=""
you cannot pass adash.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="". Currently, you can (outside documentation) pass ".not_found_404" with a custom layout.Start with a description of this PR. Then edit the list below to the items that make sense for your PR scope, and check off the boxes as you go!
Contributor Checklist
optionals
CHANGELOG.md