import os from shutil import rmtree from flask import Blueprint, render_template, request, url_for from . import git repo_url = os.environ.get("REPO_URL") repo_path = os.environ.get("REPO_PATH") bp = Blueprint("contents", __name__, url_prefix="/contents") @bp.route("/", method=("GET", "POST")) def contents(): if request.method == "POST": print(request) if request.form.get("secret") == os.environ.get("REPO_SECRET"): print("Updating the contents!") print("Cleaning the folder") rmtree(repo_path) print("Cloning the repo") git.clone_repo(repo_url, repo_path) return "Hello"