Authication using acees token does not work for twitter in python social auth


I am using python social oauth for authenticating user and it works fine when I using the simple main process means click on the link provide by them but there is one more method provided by social auth in which you have to provide the access tokens and user will be authenticated .

In second case the authentication is not working for me . It gives me

401 Client Error: Unauthorized

If its error with my app then if the same app settings work for in one case the it must have worked for other method too , also my callback URL is correct.
My traceback is as follows :

File "/home/ghrix/projects2014/test/local/lib/python2.7/site-packages/django/core/handlers/" in get_response

    response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/ghrix/projects2014/test/local/lib/python2.7/site-packages/social/apps/django_app/" in wrapper
    return func(request, backend, *args, **kwargs) File "/home/ghrix/projects2014/Test/test/social_services/" in register_by_access_token
    user = request.strategy.backend.do_auth({'oauth_token': '....', 'oauth_token_secret': '.....'}) File "/home/ghrix/projects2014/test/local/lib/python2.7/site-packages/social/backends/" in do_auth
    data = self.user_data(access_token) File "/home/ghrix/projects2014/test/local/lib/python2.7/site-packages/social/backends/" in user_data
    auth=self.oauth_auth(access_token) File "/home/ghrix/projects2014/test/local/lib/python2.7/site-packages/social/backends/" in get_json
    return self.request(url, *args, **kwargs).json() File "/home/ghrix/projects2014/test/local/lib/python2.7/site-packages/social/backends/" in request
    response.raise_for_status() File "/home/ghrix/projects2014/test/local/lib/python2.7/site-packages/requests/" in raise_for_status
    raise HTTPError(http_error_msg, response=self)

Exception Type: HTTPError at /social_service/auth/twitter/
Exception Value: 401 Client Error: Unauthorized