It is running under DEBUG = True mode. Sometimes it can throw out an error message with traceback information when encounter an error but sometimes it just display the following lines:
Unhandled Exception
An unhandled exception was thrown by the application.
I have to switch to development server to see detail message.
How can I make it always display traceback message when an error is encountered?
Just connect to the got_request_exception signal and log the exception:
from django.core.signals import got_request_exception
import logging
def log(*args, **kwargs):
logging.exception('error')
got_request_exception.connect(log)
This will log the whole trace. In the dev server, it logs in the console.
Are you using Apache?
Just out of interest is this your Production or Dev environment where you want to see the traceback?
From the DJango Book on security - Exposed error messages
Users deploying under Apache and mod_python should also make sure they have PythonDebug Off in their Apache conf files; this will ensure that any errors that occur before Django’s had a chance to load won’t be displayed publicly.
I assume you want PythonDebug On, this is recommended for Development only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With