简单的例子

from flask import Flask, render_template, redirect, url_for

app = Flask(__name__)

@app.route('/')
def main_page():
    return render_template('main.html')

@app.route('/main')
def go_to_main():
    return redirect(url_for('main_page'))