'Helper function for creating headers for the JWT authentication.'

def build_jwt_headers(self, user):

    token = JwtBuilder(user).build_token([])
    headers = {'HTTP_AUTHORIZATION': ('JWT    ' + token)}
    return headers
