title: Attribute Error Django using tweepy oauth
body: <p>I'm trying to set up oauth in Django using Tweepy. I am getting the following error. </p>
  
  <blockquote>
    <p>AttributeError at /auth/</p>
    
    <p>'dict' object has no attribute 'key'</p>
  </blockquote>
  
  <p>This occurs in the following code when I try to store the request token for later access when the user is forwarded to the callback url (<a href="http://localhost:8000/callback" rel="nofollow">http://localhost:8000/callback</a>). </p>
  
  <pre><code>def auth(request):
      # start the OAuth process, set up a handler with our details
      oauth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET, CALLBACK)
      # direct the user to the authentication url
      # if user is logged-in and authorized then transparently goto the callback URL
      try:
          auth_url = oauth.get_authorization_url()
      except tweepy.TweepError:
          return HttpResponse('error', status=500)
      # store the request token
      request.session['unauthed_token_tw'] = (oauth.request_token.key, oauth.request_token.secret) 
      return HttpResponseRedirect(auth_url)
  </code></pre>
  
  <p>I am new to Python and Django, does this error mean that the oauth.request_token is null? Could it be a problem with my callback url? Do I need to forward port 8000? Any help or pointers would be much appreciated!</p>