本文整理匯總了Python中django.conf.settings.DEFAULT_EXCEPTION_REPORTER_FILTER屬性的典型用法代碼示例。如果您正苦於以下問題:Python settings.DEFAULT_EXCEPTION_REPORTER_FILTER屬性的具體用法?Python settings.DEFAULT_EXCEPTION_REPORTER_FILTER怎麽用?Python settings.DEFAULT_EXCEPTION_REPORTER_FILTER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類django.conf.settings
的用法示例。
在下文中一共展示了settings.DEFAULT_EXCEPTION_REPORTER_FILTER屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_exception_reporter_filter
# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import DEFAULT_EXCEPTION_REPORTER_FILTER [as 別名]
def get_exception_reporter_filter(request):
global default_exception_reporter_filter
if default_exception_reporter_filter is None:
# Load the default filter for the first time and cache it.
modpath = settings.DEFAULT_EXCEPTION_REPORTER_FILTER
modname, classname = modpath.rsplit('.', 1)
try:
mod = import_module(modname)
except ImportError as e:
raise ImproperlyConfigured(
'Error importing default exception reporter filter %s: "%s"' % (modpath, e))
try:
default_exception_reporter_filter = getattr(mod, classname)()
except AttributeError:
raise ImproperlyConfigured('Default exception reporter filter module "%s" does not define a "%s" class' % (modname, classname))
if request:
return getattr(request, 'exception_reporter_filter', default_exception_reporter_filter)
else:
return default_exception_reporter_filter
示例2: get_default_exception_reporter_filter
# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import DEFAULT_EXCEPTION_REPORTER_FILTER [as 別名]
def get_default_exception_reporter_filter():
# Instantiate the default filter for the first time and cache it.
return import_string(settings.DEFAULT_EXCEPTION_REPORTER_FILTER)()