How to get select tag value in flask

Solution

You have selected {{default}}

def get_country(default):
    county_name = ["Bangladesh", "India", "USA"]
    country_default = "Bangladesh"
    if default in country_name:
        country_default = default
    country_name.remove(country_default)
    return country_name, country_default
from backend import get_country
from flask import Flask, render_template
app = Flask(__name__) 

@app.route('/')
def home():
    country_name, country_default = get_country(request.args.get("select_country"))
    return render_template("index.html", country=county_name, default=country_default)
from backend import get_country
from flask import Flask, render_template
app = Flask(__name__) 

@app.route('/', methods=['GET', 'POST'])
def home():
    country_name, country_default = get_country(request.form.get("select_country"))
    return render_template("index.html", country=county_name, default=country_default)