FlatPageOverrideMiddleware

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    from django.contrib.flatpages.views import flatpage
    from django.http import Http404
    from django.conf import settings

    class FlatpageOverrideMiddleware(object):
        def process_request(self, request):
            try:
                return flatpage(request, request.path)
            except Http404:
                return None
            except:
                if settings.DEBUG:
                    raise
                return response

More like this

  1. Restrict Flatpage To Group by nikolaj 3 years, 10 months ago
  2. Default Template Loading by nirvdrum 4 years, 6 months ago
  3. Simple Flatpage Navigation Items by bradmontgomery 2 years, 8 months ago
  4. SSL Redirect Middleware by zbyte64 3 years, 6 months ago
  5. Message exception by marinho 3 years, 3 months ago

Comments

(Forgotten your password?)