"""Главная страница — blueprint.""" from flask import Blueprint, current_app, render_template from api.http_client import HttpClient from operations.get_instances import get_organization bp = Blueprint("main", __name__) @bp.route("/") def index(): org = None error = None try: client = HttpClient( current_app.config["NUBES_API_ENDPOINT"], current_app.config["NUBES_API_TOKEN"], ) org = get_organization(client) except Exception as e: error = str(e) return render_template("index.html", organization=org, error=error)