1

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) 
Raja Simon
  • 10,126
  • 5
  • 43
  • 74
user2311504
  • 35
  • 1
  • 6

0 Answers0