支持: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>