def get_token(http_request):
    """Get token from request object

    Args:
        http_request (HTTPRequest): Http request object

    Returns:
        token (string): Token string
    """
    token = http_request.META.get('HTTP_AUTHORIZATION')
    if not token:
        return {'message': 'No token provided in request header'}
    elif 'bearer' not in token.lower():
        return {'message': 'Wrong token supplied in header'}
    token = token.split(' ')[-1]
    return token