ernestmindres commited on
Commit
85c9dc3
·
verified ·
1 Parent(s): a881801

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -33,6 +33,10 @@ from user_routes import user_bp
33
  from billing_routes import billing_bp
34
  from embed_routes import embed_bp
35
 
 
 
 
 
36
  # Dossier pour le stockage temporaire des fichiers HTML uploadés
37
  # Nous utilisons un dossier 'temp_uploads' à la racine de l'application
38
  UPLOAD_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'temp_uploads')
@@ -42,12 +46,13 @@ if not os.path.exists(UPLOAD_FOLDER):
42
  # Extensions de fichiers autorisées (très important pour la sécurité)
43
  ALLOWED_EXTENSIONS = {'html', 'htm'}
44
 
 
 
 
 
45
  app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
46
  app.config['ALLOWED_EXTENSIONS'] = ALLOWED_EXTENSIONS
47
 
48
- # --- Initialisation de l'Application Flask ---
49
- app = Flask(__name__)
50
-
51
  from werkzeug.middleware.proxy_fix import ProxyFix
52
  app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
53
  # ------------------------------------------------------------------
 
33
  from billing_routes import billing_bp
34
  from embed_routes import embed_bp
35
 
36
+ # Ajout d'une constante pour la taille maximale du contenu (16 Mo par défaut)
37
+ # Ceci corrige un potentiel NameError sur DEFAULT_MAX_CONTENT_LENGTH
38
+ DEFAULT_MAX_CONTENT_LENGTH = 16 * 1024 * 1024
39
+
40
  # Dossier pour le stockage temporaire des fichiers HTML uploadés
41
  # Nous utilisons un dossier 'temp_uploads' à la racine de l'application
42
  UPLOAD_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'temp_uploads')
 
46
  # Extensions de fichiers autorisées (très important pour la sécurité)
47
  ALLOWED_EXTENSIONS = {'html', 'htm'}
48
 
49
+ # --- Initialisation de l'Application Flask (DÉPLACÉ ICI pour corriger le NameError) ---
50
+ app = Flask(__name__)
51
+
52
+ # Maintenant, 'app' est défini et on peut lui appliquer des configurations
53
  app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
54
  app.config['ALLOWED_EXTENSIONS'] = ALLOWED_EXTENSIONS
55
 
 
 
 
56
  from werkzeug.middleware.proxy_fix import ProxyFix
57
  app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
58
  # ------------------------------------------------------------------