title: How can I get the error text in django?
body: <p>I want to get the exception text when I save value into the database.</p>
  
  <p>view.py:</p>
  
  <pre><code>if request.method == 'POST':
      form = CustomerForm(request.POST)        
  
      if form.is_valid():
          try:
              customer = form.save(commit=False)           
              customer.save()
          except DatabaseError:
              message = 'Database Error: ' + str(??? text error ???)
  </code></pre>