In django, is there any way to capture the python script exception and present in the html page, rather than allowing django to provide 500 or page full of exception page(debug=on)
try:
result = my_resolver.query(host,raise_on_no_answer=False)
for a in result:
r = r.address
except resolver.NXDOMAIN:
r = "No record found"
args = {'message':r}
return render(request, 'dns.html', args)