It might be a Python newbie question...
try:
#do something
except:
raise Exception(\'XYZ has gone wrong...\')
Even with DEBUG=True,
Another suggestion could be to use Django messaging framework to display flash messages, instead of an error page.
from django.contrib import messages
#...
def another_view(request):
#...
context = {'foo': 'bar'}
try:
#... some stuff here
except SomeException as e:
messages.add_message(request, messages.ERROR, e)
return render(request, 'appname/another_view.html', context)
And then in the view as in Django documentation:
{% if messages %}
{% endif %}
{% endfor %}