Answer the question
In order to leave comments, you need to log in
Is there a common controller?
I have several routes that display multiple pages:
from flask import Flask, render_template, request, Response, make_response, redirect
app = Flask(__name__)
@app.route('/')
def auth():
return render_template('auth.html')
@app.route('/page0')
def admin():
return render_template('page0.html')
@app.route('/page1')
return render_template('page1.html')
Answer the question
In order to leave comments, you need to log in
If this "big piece" just needs to be executed (without any parameters) then I would stuff it into before_request
You can also make a decorator, then you won’t need to wedge into the function code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question