<reponame>culee/c4e<filename>03 Web/Web 01/homework/ex2/app.py
from flask import Flask, render_template, redirect
app = Flask(__name__)

users = {
    "quy" : {
        "name" : "<NAME>",
        "age" : 20,
        "gender": 1,
        "hobby": "programming"
    },
    "tuananh" : {
        "name" : "<NAME>",
        "age" : 22,
        "gender" : 1,
        "hobby" : "programming"
    },
    "chi" : {
        "name" : "<NAME>",
        "age" : 23,
        "gender" : 0,
        "hobby" : "teaching English"
    },
}

@app.route("/user/<username>")
def user(username):
    if username in users:
        return render_template("users.html", users = users[username])
    else:
        return "User not found!"

if __name__ == "__main__":
    app.run(debug = True)
