Skip to content

Instantly share code, notes, and snippets.

@chriskief
Created October 24, 2013 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriskief/7131025 to your computer and use it in GitHub Desktop.
Save chriskief/7131025 to your computer and use it in GitHub Desktop.
from django.shortcuts import render
from app.exceptions.custom import NotFound
class ExceptionMiddleware(object):
def process_exception(self, request, exception):
if type(exception) == NotFound:
return render(request, exception.template)
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment