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
- Restrict Flatpage To Group by nikolaj 3 years, 10 months ago
- Default Template Loading by nirvdrum 4 years, 6 months ago
- Simple Flatpage Navigation Items by bradmontgomery 2 years, 8 months ago
- SSL Redirect Middleware by zbyte64 3 years, 6 months ago
- Message exception by marinho 3 years, 3 months ago
Comments