from flask import render_template, Blueprint, request, redirect, url_for, flash import requests from collections import defaultdict home_app = Blueprint('home', __name__) @home_app.route('/backstage/home') def home(): response = requests.get('http://127.0.0.1:5000/api/home') if response.status_code == 200: return render_template('home.html', title='首頁', contents=response.json())