title: Raising Exceptions in Django REST
body: <p>I'm trying to test the exceptions within the django rest framework.
  Based on <a href="http://www.django-rest-framework.org/api-guide/exceptions/" rel="noreferrer">http://www.django-rest-framework.org/api-guide/exceptions/</a> raising NotFound, </p>
  
  <blockquote>
    <p>By default this exception results in a response with the HTTP status
    code "404 Not Found".</p>
  </blockquote>
  
  <p>However when I issue a GET (to /example1) I get a 500 with ,</p>
  
  <pre><code>Request Method: GET
  Request URL:    http://192.168.59.103:8002/example1
  Django Version: 1.8.3
  Exception Type: NotFound
  Exception Value:    
  not found
  Exception Location: /home/djangoapp/testtools/api/views.py in example1, line 7
  Python Executable:  /usr/bin/python
  </code></pre>
  
  <p>details below,</p>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>REST_FRAMEWORK = {'EXCEPTION_HANDLER':'rest_framework.views.exception_handler'}
  
  INSTALLED_APPS = (
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'rest_framework',
  )
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>from django.conf.urls import include, url
  from api import views
  
  urlpatterns = [
      url(r'example1', views.example1),
  ]
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>from rest_framework import status
  from rest_framework.decorators import api_view
  from rest_framework.response import Response
  from rest_framework.exceptions import APIException,ParseError,NotFound
  
  def example1(request):                                                                                                                               
      raise NotFound("not found")
  </code></pre>
  
  <p>Any ideas ?</p>