{"action":"created","issue":{"url":"https://api.github.com/repos/ramusus/django-oauth-tokens/issues/6","labels_url":"https://api.github.com/repos/ramusus/django-oauth-tokens/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/ramusus/django-oauth-tokens/issues/6/comments","events_url":"https://api.github.com/repos/ramusus/django-oauth-tokens/issues/6/events","html_url":"https://github.com/ramusus/django-oauth-tokens/issues/6","id":57897908,"number":6,"title":"NoActiveTokens exception is thrown","user":{"login":"nachouve","id":874798,"avatar_url":"https://avatars.githubusercontent.com/u/874798?v=3","gravatar_id":"","url":"https://api.github.com/users/nachouve","html_url":"https://github.com/nachouve","followers_url":"https://api.github.com/users/nachouve/followers","following_url":"https://api.github.com/users/nachouve/following{/other_user}","gists_url":"https://api.github.com/users/nachouve/gists{/gist_id}","starred_url":"https://api.github.com/users/nachouve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nachouve/subscriptions","organizations_url":"https://api.github.com/users/nachouve/orgs","repos_url":"https://api.github.com/users/nachouve/repos","events_url":"https://api.github.com/users/nachouve/events{/privacy}","received_events_url":"https://api.github.com/users/nachouve/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-17T08:49:58Z","updated_at":"2015-02-24T07:52:28Z","closed_at":"2015-02-20T08:47:08Z","body":"I have an app running nicely using django-twitter-api with django-oauth-tokens.\r\n\r\nAfter some time running, a *NoActiveTokens* exception is thrown. This is the traceback\r\n\r\n```\r\nFile \"/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py\" in get_response\r\n  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\nFile \"/app/myapp/views/views_actions.py\" in safe_update\r\n  249.             update_user = updateUser(request,user.screen_name)\r\nFile \"/app/myapp/views/views_actions.py\" in updateUser\r\n  39.     api = twitter_api.api.TwitterApi().get_api() #other resources \"user,help,...\" \r\nFile \"/app/.heroku/python/lib/python2.7/site-packages/twitter_api/api.py\" in get_api\r\n  26.         token = self.get_token(**kwargs)\r\nFile \"/app/.heroku/python/lib/python2.7/site-packages/oauth_tokens/api.py\" in get_token\r\n  151.                     \"There is no active AccessTokens for provider %s with kwargs %s\" % (self.provider, kwargs))\r\n\r\nException Type: NoActiveTokens at /safe_update/\r\nException Value: There is no active AccessTokens for provider twitter with kwargs {}\r\n```\r\n\r\nAfter check on the DB I see there is a valid register on AccessToken:\r\n\r\n```ipython\r\nIn [1]: from oauth_tokens.models import *\r\nIn [2]: tokens  = AccessToken.objects.all()                                                                                                                                                                                          \r\nIn [3]: print len(tokens)\r\nOut[3] 1\r\nIn [4]: tokens[0]\r\nOut[4]: <AccessToken: #00000000000000000-XXXXXXXXXXXXX>\r\nIn [5]: t = tokens[0] \r\n...\r\nIn [9]: t.provider\r\nOut[9]: u'twitter'\r\nIn [10]: str(t.expires_at)\r\nOut[10]: 'None'\r\n```\r\n\r\nAfter restart the webserver it works again. \r\n\r\nAny clues to solve this problem? Thank you!"},"comment":{"url":"https://api.github.com/repos/ramusus/django-oauth-tokens/issues/comments/75713244","html_url":"https://github.com/ramusus/django-oauth-tokens/issues/6#issuecomment-75713244","issue_url":"https://api.github.com/repos/ramusus/django-oauth-tokens/issues/6","id":75713244,"user":{"login":"nachouve","id":874798,"avatar_url":"https://avatars.githubusercontent.com/u/874798?v=3","gravatar_id":"","url":"https://api.github.com/users/nachouve","html_url":"https://github.com/nachouve","followers_url":"https://api.github.com/users/nachouve/followers","following_url":"https://api.github.com/users/nachouve/following{/other_user}","gists_url":"https://api.github.com/users/nachouve/gists{/gist_id}","starred_url":"https://api.github.com/users/nachouve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nachouve/subscriptions","organizations_url":"https://api.github.com/users/nachouve/orgs","repos_url":"https://api.github.com/users/nachouve/repos","events_url":"https://api.github.com/users/nachouve/events{/privacy}","received_events_url":"https://api.github.com/users/nachouve/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T07:52:28Z","updated_at":"2015-02-24T07:52:28Z","body":"It works perfectly! Thank you very much! "}}