from flask import Blueprint, render_template, request, jsonify, redirect, url_for

views = Blueprint(__name__, "views")

@views.route("/")
def home():
    return render_template("index.html", name="Sharvil", age="12")

@views.route("/profile")
def profile():
    return render_template("profile.html", name="Sharvil")

@views.route("/json")
def get_json():
    return jsonify({'name': 'Sharvil', 'age': 10})

@views.route("/data")
def get_data():
    data = request.json
    return jsonify(data)

@views.route("/go-to-home")
def go_to_home():
    return redirect(url_for("views.home"))