누구든지이 장고 미들웨어에 대한 경고의 실제 이유를 말할 수 있습니까? 어떻게 해결할 수 있습니까?DeprecationWarning : BaseException.message는 Python 2.6 예외로 더 이상 사용되지 않습니다 .__ class__, exception.message,
나는이 메시지가 무엇입니까 :
class GeneralMiddleware(object):
def process_exception(self, request, exception):
if exception.__class__ is SandboxError:
# someone is trying to access a sandbox that he has no
# permission to
return HttpResponseRedirect("/notpermitted/")
exc_type, value, tb = sys.exc_info()
data = traceback.format_tb(
tb, None) + traceback.format_exception_only(
exc_type, value)
msg = (
"Failure when calling method:\n"
u"URL:'%s'\nMethod:'%s'\nException Type:'%s'\n"
u"Error Message '%s'\nFull Message:\n%s"
% (request.get_full_path(), request.method,
exception.__class__, exception.message,
'예외 .__ class__는 SandboxError' 대신'isinstance (exception, SandboxError)'를 시도하십시오. – Blender
믹서기에는 작동하지 않습니다 ... 빠른 응답을 주셔서 감사합니다. 실제로 예외에 대한 경고가 나타납니다 .__ class__, exception.message this line. – PythonDev