I am using django 1.2.7 and python 2.6. If I use this code: (with an identation error on porpuse)
def myview(request):
try:
if x:
print 'x'
except:
return HttpResponseServerError('bazinga')
then I don't get my response. I get django 500 response.
but if I change the code to this:
def myview(request):
try:
if x:
print 'x'
except:
return HttpResponseServerError('bazinga')
now I get my own 500 with the bazinga written.
How can I catch the identation error in the first example ?
Just as my try-except catch the exception in the 2nd example.