Enhance Article editor 2

This commit is contained in:
2026-03-25 16:19:11 -04:00
parent 3ba7eae390
commit bee7146073
4 changed files with 360 additions and 247 deletions
+10 -2
View File
@@ -31,7 +31,15 @@ class Config:
APP_BASE_URL = os.environ.get('APP_BASE_URL', 'http://localhost:5000')
# Uploads
UPLOAD_FOLDER = os.environ.get('UPLOAD_FOLDER', 'app/static/uploads')
# UPLOAD_FOLDER must be an absolute path so that save (os.path.join) and
# serve (send_from_directory) always resolve to the same directory regardless
# of the process CWD. The default anchors to the project root via __file__.
_project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
_raw_upload = os.environ.get('UPLOAD_FOLDER', '')
UPLOAD_FOLDER = (
_raw_upload if (_raw_upload and os.path.isabs(_raw_upload))
else os.path.join(_project_root, 'app', 'static', 'uploads')
)
MAX_CONTENT_LENGTH = int(os.environ.get('MAX_CONTENT_LENGTH', 16 * 1024 * 1024))
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif', 'pdf', 'doc', 'docx', 'txt', 'zip', 'log'}
@@ -56,4 +64,4 @@ config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'default': ProductionConfig
}
}