title: In Django, how can I get an exception's message?
body: <p>In a view function, I have something like:</p>
  
  <pre><code>try:
      url = request.POST.get('u', '')
      if len(url) == 0:
          raise ValidationError('Empty URL')
  except ValidationError, err:
      print err
  </code></pre>
  
  <p>The output is a string: <code>[u'Empty URL']</code></p>
  
  <p>When I try to pass the error message to my template (stuffed in a dict, something like <code>{ 'error_message': err.value }</code>), the template successfully gets the message (using <code>{{ error_message }}</code>).</p>
  
  <p>The problem is that I get the exact same string as above, <code>[u'Empty URL']</code>, with the <code>[u'...']</code>!</p>
  
  <p>How do I get rid of that?</p>
  
  <p>(Python 2.6.5, Django 1.2.4, Xubuntu 10.04)</p>