コード例 #1
0
ファイル: controllers.py プロジェクト: dmaust/Perifile
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())
コード例 #2
0
ファイル: controllers.py プロジェクト: dmaust/Perifile
def user_data(username):
    metrics = common.fetch_user_cached(username)
    return jsonify(metrics=metrics.to_dict())