# Path: twitter/utils.py
# def _parse_response(text):
# def get_request_token():
# def get_access_token(oauth_verifier, oauth_token_pair):
# def get_user_data(screen_name, oauth_token_pair):
# def authorize_request(method, url, param_data=None, extra_oauth_params=None, oauth_token_pair=None, body_data=None):
# def get_signature(http_method, url, parameter_values, oauth_token_secret=''):


from django import http
from django.conf import settings
from django.views.decorators.http import require_http_methods
from twitter import utils
import json
        user_data = utils.get_user_data(twitter_handle, creds)
        bio_data = {
            'avatar': user_data['profile_image_url'],
            'name': user_data['name'],
            'bio': user_data['description']
        }
        if '_normal' in bio_data['avatar']:
            bio_data['avatar'] = bio_data['avatar'].replace('_normal', '')
        return http.HttpResponse(json.dumps(bio_data))
    except:
        return http.HttpResponseNotFound()


def old(request):
    request_token_dict = utils.get_request_token()
    request.session['oauth_token'] = request_token_dict['oauth_token']
    request.session['oauth_token_secret'] = request_token_dict['oauth_token_secret']
    redirect_url = 'https://api.twitter.com/oauth/authenticate?oauth_token={0}'.format(
        request_token_dict['oauth_token']
    )
    return http.HttpResponseRedirect(redirect_url)


def oauth_callback(request):
    oauth_token = request.GET.get('oauth_token')
    oauth_verifier = request.GET.get('oauth_verifier')

    oauth_token_secret = request.session['oauth_token_secret']
    access_token_dict = utils.get_access_token(oauth_verifier, (oauth_token, oauth_token_secret))
    

# Path: twitter/utils.py
# def _parse_response(text):
# def get_request_token():
# def get_access_token(oauth_verifier, oauth_token_pair):
# def get_user_data(screen_name, oauth_token_pair):
# def authorize_request(method, url, param_data=None, extra_oauth_params=None, oauth_token_pair=None, body_data=None):
# def get_signature(http_method, url, parameter_values, oauth_token_secret=''):


# Path: twitter/views.py
from django import http
from django.conf import settings
from django.views.decorators.http import require_http_methods
from twitter import utils
import json

        user_data = utils.get_user_data(twitter_handle, creds)
        bio_data = {
            'avatar': user_data['profile_image_url'],
            'name': user_data['name'],
            'bio': user_data['description']
        }
        if '_normal' in bio_data['avatar']:
            bio_data['avatar'] = bio_data['avatar'].replace('_normal', '')
        return http.HttpResponse(json.dumps(bio_data))
    except:
        return http.HttpResponseNotFound()


def old(request):
    request_token_dict = utils.get_request_token()
    request.session['oauth_token'] = request_token_dict['oauth_token']
    request.session['oauth_token_secret'] = request_token_dict['oauth_token_secret']
    redirect_url = 'https://api.twitter.com/oauth/authenticate?oauth_token={0}'.format(
        request_token_dict['oauth_token']
    )
    return http.HttpResponseRedirect(redirect_url)


def oauth_callback(request):
    oauth_token = request.GET.get('oauth_token')
    oauth_verifier = request.GET.get('oauth_verifier')

    oauth_token_secret = request.session['oauth_token_secret']
    access_token_dict = utils.get_access_token(oauth_verifier, (oauth_token, oauth_token_secret))
    

    user = utils.get_user_data(