Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Issue #52: Use a catch-all in urls.py instead of PageFallbackMi…
…ddleware
- Loading branch information
Showing
3 changed files
with
16 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46799b0
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.
uhm... i already have a catch-all in my urls in a project of mine! With the middleware i can let a view to catch the request, then raise a 404 if there are no matching items in the DB, and then middleware catches the 404 and it will serve the Fiber page. What's the plus of this removal?
46799b0
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.
#52 shows why we want to do this... Do you really need your own catch-all? Maybe you can use something like get_object_or_404 for what you are trying to achieve?
46799b0
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.
i understand... i'll modify my catch-all to manage both fiber and my own view. Maybe it would be good to write docs about this choice. Thank you!