generated from othneildrew/Best-README-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
37 lines (24 loc) · 749 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os
from flask import Flask, render_template
import pulumi.automation as auto
import dotenv
dotenv.load_dotenv()
def ensure_plugins():
ws = auto.LocalWorkspace()
ws.install_plugin("aws", "v4.0.0")
def create_app():
ensure_plugins()
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY=os.environ.get("SECRET_KEY"),
PROJECT_NAME=os.environ.get("PROJECT_NAME"),
PULUMI_ORG=os.environ.get("PULUMI_ORG"),
)
@app.route("/", methods=["GET"])
def index():
return render_template("index.html")
import sites
app.register_blueprint(sites.bp)
import virtual_machines
app.register_blueprint(virtual_machines.bp)
return app