flask avatars从社交网站获得头像(flask 83)

2019-08-20 16:54:16 浏览数 (1)

支持:twitter, facebook, instagram, gravatar 填入用户名

py

from flask import Flask, render_template from flask_avatars import Avatars

app = Flask(name) avatars = Avatars(app)

html

<p>{% raw %}{{ avatars.social_media('realDonaldTrump') }}{% endraw %}: <img src="{{ avatars.social_media('realDonaldTrump') }}"></p> <p>{% raw %}{{ avatars.social_media('stefsunyanzi', platform='instagram', size='large') }}{% endraw %}: <img src="{{ avatars.social_media('stefsunyanzi', platform='instagram', size='large') }}"></p>

0 人点赞