Ejemplo n.º 1
0
def profile_page(username):
    metrics = common.fetch_user_cached(username)

    pattern = re.compile('^[A-Za-z0-9]*$')
    if not pattern.match(username):
        return "Invalid username"

    return render_template("profile.html", username=username, **metrics.to_dict())
Ejemplo n.º 2
0
def user_data(username):
    metrics = common.fetch_user_cached(username)
    return jsonify(metrics=metrics.to_dict())