Ajout de quelques changements pour acces libre

This commit is contained in:
nono
2025-06-18 11:57:34 +02:00
committed by n07070
parent 0601fe8190
commit aa6e11c537
4 changed files with 9 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ import os # For VARS from the shell.
# Variables
app = Flask(__name__)
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
# Load the configuration file
try:
@@ -44,13 +45,12 @@ try:
os.mkdir(UPLOAD_FOLDER)
app.logger.debug(f"Directory '{UPLOAD_FOLDER}' created successfully.")
except FileExistsError:
app.logger.error(f"Directory '{UPLOAD_FOLDER}' already exists.")
app.logger.debug(f"Directory '{UPLOAD_FOLDER}' already exists.")
except PermissionError:
app.logger.error(f"Permission denied: Unable to create '{UPLOAD_FOLDER}'.")
except Exception as e:
app.logger.error(f"An error occurred: {e}")
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
# Output the config file
if os.getenv('LIPY_DEBUG') == True: