title: How to use sentry/raven in django views
body: <p>I managed to install sentry successfully and I can see the sentry interface webservice at localhost and doing a </p>
  
  <pre><code>raven test http://jsifslkdjfklsdfjklsdjfklMYCODE 
  </code></pre>
  
  <p>works, the tests shows up in the interface.</p>
  
  <p>The problem is I can't find any examples or documentation on what exactly should I put on my views and my settings.</p>
  
  <p>I know I have to add to my <code>INSTALLED_APPS</code> </p>
  
  <p>'sentry',
  'raven.contrib.django',</p>
  
  <p>And I also added </p>
  
  <pre><code>SENTRY_DNS = 'http://jsifslkdjfklsdfjklsdjfklMYCODE'
  </code></pre>
  
  <p>This next two lines appear in the docs but it doesnt say where do they go</p>
  
  <pre><code>from raven.contrib.django.models import client
  client.captureException()
  </code></pre>
  
  <p>I tried in <code>settings.py</code> but still I can't get my views to log anything. 
  I also added this </p>
  
  <pre><code>LOGGING = {
      'version': 1,
      'disable_existing_loggers': True,
      'root': {
          'level': 'WARNING',
          'handlers': ['sentry'],
      },
      'formatters': {
          'verbose': {
              'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
          },
      },
      'handlers': {
          'sentry': {
              'level': 'ERROR',
              'class': 'raven.contrib.django.handlers.SentryHandler',
          },
          'console': {
              'level': 'DEBUG',
              'class': 'logging.StreamHandler',
              'formatter': 'verbose'
          }
      },
      'loggers': {
          'django.db.backends': {
              'level': 'ERROR',
              'handlers': ['console'],
              'propagate': False,
          },
          'raven': {
              'level': 'DEBUG',
              'handlers': ['console'],
              'propagate': False,
          },
          'sentry.errors': {
              'level': 'DEBUG',
              'handlers': ['console'],
              'propagate': False,
          },
      },
  }
  </code></pre>
  
  <p>And in my views I added this:</p>
  
  <pre><code>import logging
  logger = logging.getLogger()
  
  def home(request,template_name): 
      logger.error('There was some crazy error lol', exc_info=True, extra={'request': request, })
      return render_to_response(template_name,context, context_instance=RequestContext(request))
  </code></pre>
  
  <p>I have no other code related to logging apart from what you see here, What am I missing?</p>