@app.route('/secret_page')
def secret_page():
if User.query.get(5):
return render_template('test.html', title='Страница',)
else:
return redirect(url_for('index'))
if User.query.get(5):
from flask_login import login_required, current_user
@app.route('/secret_page')
@login_required
def secret_page():
if current_user.get_id() == 5:
return render_template('test.html', title='Страница',)
return redirect(url_for('index'))