當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python Django ExceptionReporter.get_traceback_data用法及代碼示例

本文介紹django.views.debug.ExceptionReporter.get_traceback_data的用法。

聲明

get_traceback_data()

返回包含回溯信息的字典。

這是自定義異常報告的主要擴展點,例如:

from django.views.debug import ExceptionReporter


class CustomExceptionReporter(ExceptionReporter):
    def get_traceback_data(self):
        data = super().get_traceback_data()
        # ... remove/add something here ...
        return data

相關用法


注:本文由純淨天空篩選整理自djangoproject.com大神的英文原創作品 django.views.debug.ExceptionReporter.get_traceback_data。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。