import os @app.route('/') def index(): try: return render_template('index.html') except Exception as e: # This will tell us exactly where the server is looking cwd = os.getcwd() files = os.listdir(cwd) template_dir = os.path.join(cwd, 'templates') t_files = os.listdir(template_dir) if os.path.exists(template_dir) else "FOLDER MISSING" error_msg = f""" AEGIS PERIMETER ERROR: Template Not Found. Current Dir: {cwd} Root Files: {files} Template Files: {t_files} Error Detail: {e} """ logger.error(error_msg) return error_msg, 500