【问题标题】:Django-piston make piston return full traceback of exceptionDjango-piston 使活塞返回异常的完整回溯
【发布时间】:2013-01-07 15:27:24
【问题描述】:

如何使活塞返回异常的完整追溯。默认情况下,它只返回最后一个错误文本。喜欢

id() takes exactly one argument (0 given)

需要知道哪个文件和哪一行...

【问题讨论】:

    标签: django django-piston


    【解决方案1】:

    Piston 通过utils.rc 加载http 状态响应,不会引发错误。

    来自文档:

    Configuration variables
    Piston is configurable in a couple of ways, which allows more granular 
    control of some areas without editing the code.
    
    Setting                         Meaning
    settings.PISTON_EMAIL_ERRORS    If (when) Piston crashes, it will email the 
                                    administrators a backtrace (like the Django one
                                    you see during DEBUG = True)
    settings.PISTON_DISPLAY_ERRORS  Upon crashing, will display a small backtrace 
                                    to the client, including the method signature 
                                    expected.
    settings.PISTON_STREAM_OUTPUT   When enabled, Piston will instruct Django to 
                                    stream the output to the client, but please read
                                    streaming before enabling it.
    

    我建议设置一个记录器,sentryraven 一起使用相当方便,您可以配置自己的日志级别和处理程序。

    【讨论】:

      猜你喜欢
      • 2012-05-10
      • 1970-01-01
      • 2011-05-19
      • 2012-10-24
      • 1970-01-01
      • 1970-01-01
      • 2015-04-15
      • 2015-06-06
      • 1970-01-01
      相关资源
      最近更新 更多