我正在尝试用python在我的帐户页面上显示Azure广告中的照片

我正在尝试用python在我的帐户页面上显示Azure广告中的照片,python,azure,azure-active-directory,microsoft-graph-api,Python,Azure,Azure Active Directory,Microsoft Graph Api,我正在尝试从Azure AD获取配置文件图像,并希望在div中显示该图像。我的服务器代码如下,但我不确定如何在div中显示该图像 def account(): token = _get_token_from_cache(app_config.SCOPE) if not token: return redirect(url_for("login")) graph_data = requests.get( # Use token to call downstream s

我正在尝试从Azure AD获取配置文件图像,并希望在div中显示该图像。我的服务器代码如下,但我不确定如何在div中显示该图像

def account():
token = _get_token_from_cache(app_config.SCOPE)
if not token:
    return redirect(url_for("login"))
graph_data = requests.get(  # Use token to call downstream service
    app_config.ACCOUNT_INFO,
    headers={'Authorization': 'Bearer ' + token['access_token']},
    ).json()
#endpoint = '/users/firstname.lastname@somecompany.com/photo/$value'
photo_responce = requests.get(app_config.PHOTO_ENDPOINT, headers={'Authorization': 'Bearer ' + token['access_token']},stream=True)
photo_status_code = photo_responce.ok
if photo_status_code:
    photo = photo_responce.raw.read()
else:
    photo = ''
从这段代码中,我得到了照片的原始数据,如下所示

b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00`\x00`\x00\x00\xff\xdb\x00C\x00\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xff\xdb\x00C\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xff\xc0\x00\x11\x08\x02\x88\x02\x88\x03\x01"\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00\x1f\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\xff\xc4\x00\xb5\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05\x04\x04\x00\x00\x01}\x01\x02\x03\x00\x04\x11\x05\x12!1A\x06\x13Qa\x07"q\x142\x81\x91\xa1\x08#B\xb1\xc1\x15R\xd1\xf0$3br\x82\t\n\x16\x17\x18\x19\x1a%&\'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xc4\x00\x1f\x01\x00\x03\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\xff\xc4\x00\xb5\x11\x00\x02\x01\x02\x04\x04\x03\x04\x07\x05\x04\x04\x00\x01\x02w\x00\x01\x02\x03\x11\x04\x05!1\x06\x12AQ\x07aq\x13"2\x81\x08\x14B\x91\xa1\xb1\xc1\t#3R\xf0\x15br\xd1\n\x16$4\xe1%\xf1\x17\x18\x19\x1a&\'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2\xa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xe0\x1e3W\xa1\xda\xa4\xe7<p\x0e>_\xee\x8c\x92\x0eT\xf2\x1b\xa7\xa9\xe9\x93\x1f\x94\t\xe8\xc7%J\x8c\x12\xc0\x01\xce\xc2\x08\xe3p?.G\xcb\x9e98\xb3\n`m\xc1#\x1dy\xc0\x04\x11\xeb\x8eO\x04\xf3\x81\x9e8\x14\x01e@\x19\xe0\x1d\xa3\x8e\xd9\x1c\x0cd\x9e\xb9\xc6=@\xdd\x9eja\x903\xf7A#\xa7\x00\x1cg\x04u\xe9\x8c\x1c\xed\xe0\x81H\xa0\x85\\\xa8\xc8\x00\x81\x90A\xc6@\x038\xdd\xf2\x91\x8c\xf3\x8f\x97\x18 T\x87*2N0\xa0\x16\xc7Bq\x80\x0e>P\xcb\x9e\x98 \x93\xcf\x02\x80"8\xc7\xca6\x8epI\xe3<\x13\x8ct\xe0\x86<c9\xfb\xf9 W\xc8\xe7\x19\x00\x00@\x18\xe0\xf3\x86\x07\x93\xdf\x85\xc0;z\xf2\x0e,\x11\x91\x91\xce\xe0Alg\x91\xdc\xa9\xc6>PA\'\x90[\xa1\x07%\x84\x16\xe7\x1bHl\x9e\xbd\x062Fx\xc0\xea\x06y\xc9\xeesI\xdfM:\xeb\xe8\x05v\xc8\x1d9\r\xcb\x02\xaa\xdd\xba\x9e\x06s\xd3\x8e\xa4\x13\xda\x98\xaayV\xc19<\xff\x00\x1f<\x0cq\xb9\xbeb8\xfb\xa7\xa9\x1c`\xcc3\xb4mP~V \x03\xf2\xe0\xf3\x9c\x86\x1f9=\x01\x18;\xb0\x1b\x03\x00\n\xd9\xc9;s\xfc \xf5\x04.@# r\t\x04\x8f\x98\x9c`\x01L\x06`\x0c\xb7Bwt\x0c\xc7\x00`g8\xe4\x82?\x8bv;\x80\x06#\x99\x00F\xca\xe3\xe6\xe009\xc7\\\x10s\x91\x9e\x06>`{|\xb9\xab\x1fw\x1bp\xdbB\xed\x04\x15\xc1\xeb\xb8\x828$\x93\xbb9\xe9\xcf\x0b\xc42\x06\\\xe7-\xb87\x07\x81\xbb\xf8H\xceq\xcfL\x83\xdcg\x90(\x03\x02\xe7\'\xd7\x04\xf1\x93\xdbv\x18\x11\xcf^F\x07c\x9c\xfaQe=N\xdf\x98\x90H=A\xc8Q\x82\x0eq\xc9\xcf\xf7\x81\xc1 \x83W\xa7\xdd\xe6\xb7\x079\x19 \x1c\r\xc3 \x108\xc7A\xf2\x82Fq\x9e\xb9\xa7\xf3\x1c\xe3$\xe0\xe7\x1fx\xf3\xc2\x83\x9cc\xb3\x1c\x83\xe9\x9eh\x01\xa8\x98\x18\xdd\x80O|\x83\x83\xc8\'\x93\x96C\xd0\xfarE]L7L\xed\x03?1#8\xecH\xce9\x01pG\x00\x8c\xa8\xc9\xa8\x141\xdc\xa4\xe0d)\xce\x18\xe4\x8e\xbc}\xe1\xc1\xe0\xf2F;dU\xa5\xc9

中国政府的一名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名名\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\xff\x中国国家对西藏的中央财政404040中央中央中央中央中央对中央中央中央对404040中央中央中央对中央中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对中央对01\01\01\01\01\01\01\01\01\01\01\01\01\01\01 01 \\\01 4001 \\\01 4001\01\01\01 \\01 \\01\01 01 01 \\\01 \\01\01 01\01\\01\01 \01\01 01\01 01 01\\\\01\01 \\\\\\01 01\01\01 01\01 01\01 \01\01\01\01\01\x01\x01\x01\xff\xc0\x00\x11\x08\x02\x88\x02\x88\x03\x01\X0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 03\x00\x04\x11\x05\x12!1A\x06\x13Qa\x07“q\x142\x81\x91\xa1\x08\B\xb1\xc1\x15R\xd1\xf0$3br\x82\t\n\x16\x17\x18\x19\x1a%&\”()*456789:456789:中国政府对普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通普通4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xc4\x00\x1f\01\x01\x01\x01\0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ \ \ \ \ \ \X0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \x08\x14B\x91\xa1\xb1\xc1\t#3R\xf0\x15br\xd1\n\x16$4\xe1%\xf1\x17\x18\x19\x1a&\'()*56788 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 B\xa7\xa9\xe9\x93\x1f\x94\t\xe8\xc7%J\x8c\x12\xc0\x01\xce\xc2\x08\xe3p?.G\xcb\x9e98\xb3\n`m\xc1\x1dy\xc0\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\X10\X10\X10\X10\X10\X8\X8\X8\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10 10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\X10\10\X10\10\10\\\x16\xc7Bq\x80\x0e>P\xcb\x9e\x98\x93\xcf\x02\x80“8\xc7\xca6\x8epI\xe3您看到的数据是JPEG图像格式的数据。请查看提供的代码,然后使用该图像显示在div标记中。

这是JPEG图像数据,请查看并使用该图像。移动此选项以回答问题。