class NotFoundView(TemplateView):
    template_name = 'errors/404.html'

@classmethod
def get_rendered_view(cls):
    as_view_fn = cls.as_view()

def view_fn(request):
    response = as_view_fn(request)
response.render()
return response
How to specify a custom 404 view for Django using Class Based Views?