exception_traceback.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:dsmr-reader 作者: dennissiemensma 项目源码 文件源码
def process_exception(self, request, exception):
        if settings.DEBUG:
            # Default exception handling, which is already nice when in DEBUG mode.
            return

        return HttpResponseServerError(
            render_to_string(
                '500.html', {
                    'exception': exception,
                    'exception_class': exception.__class__.__name__,
                    'error_trace': traceback.format_tb(exception.__traceback__, limit=100)
                }
            )
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号