Pylons: How to write a custom 404 page?
问题 So this question has been asked before, but not answered in great detail. I want to override the default Pylons error page to make a nicer, custom one. I've got as far as overwriting the controller in error.py , as follows: def document(self): """Render the error document""" resp = request.environ.get('pylons.original_response') content = literal(resp.body) or cgi.escape(request.GET.get('message', '')) custom_error_template = literal("""\ # some brief HTML here """) page = custom_error