Answers for "flask route redirect to another route"

0

how to redirect to another route in flask

from flask import Flask, render_templates

app = Flask(__name__)


@app.route("/")
def index:
  return render_template("index.html")


@app.route("/home")
def home:
	return redirect("/", code=302)
  
  
app.run()
Posted by: Guest on January-21-2021

Code answers related to "flask route redirect to another route"

Python Answers by Framework

Browse Popular Code Answers by Language