Recommend to avoid FlatpageFallbackMiddleware unless absolutely required
|Reported by:||Patryk Zawadzki||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
In most cases you don't need conflicting routing rules in
urls.py so it's easier to just
include('django.contrib.flatpages.urls'). As a free bonus you get to avoid all kinds of problems with other middleware, contextprocessors and the CSRF framework.
I can see how the middleware is useful if for some reason you have to put the flat pages in the same URL prefix another application uses but it's a workaround that breaks the documented routing behavior. I for one don't expect apps to provide their own url routing middleware instead of
urls.py and I can't see how flatpages is an exception here.
Change History (6)
comment:3 Changed 5 years ago by
|Patch needs improvement:||set|