Encoding an image file with base64,encoded_string = base64.b64encode(image_file.read())