How can I get Django to print the debug information to the console?

后端 未结 6 1834
故里飘歌
故里飘歌 2020-12-04 19:57

I\'m using urlib to hit my app not a browser so I can\'t see the debug screen when an error occurs. What\'s the best way to send the normal debug info to the console or a fi

6条回答
  •  难免孤独
    2020-12-04 20:31

    The answer for this is to create a django middleware to catch all exeptions.

    When you catch them, you can redirect them to whatever you want.

    Documentation is here:

    http://docs.djangoproject.com/en/dev/topics/http/middleware/#process-exception

提交回复
热议问题