how to set route from different python file in flask

Solutions on MaxInterview for how to set route from different python file in flask by the best coders in the world

showing results for - "how to set route from different python file in flask"
Ezio
04 Jul 2018
1simple_page = Blueprint('simple_page', __name__, template_folder='templates')
2@simple_page.route('/<page>')
3def show(page):
4    # stuff
5   
6from yourapplication.simple_page import simple_page
7
8app = Flask(__name__)
9app.register_blueprint(simple_page)