1 from django.http import Http404
2 from django.conf import settings
4 from forum.views.meta import page
6 class CustomPagesFallbackMiddleware(object):
7 def process_response(self, request, response):
8 if response.status_code != 404:
9 return response # No need to check for a flatpage for non-404 responses.
12 # Return the original response if any errors happened. Because this
13 # is a middleware, we can't assume the errors will be caught elsewhere.