diff --git a/backend/.env.example b/backend/.env.example index 7b0b770..34914c6 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -2,4 +2,6 @@ DEBUG=True DATABASE_URL=sqlite:///files/data.db OPENCV_VIDEO_SOURCE=0 SECRET_KEY=change-this-key -JWT_SECRET_KEY=change-this-key-to-something-different \ No newline at end of file +JWT_SECRET_KEY=change-this-key-to-something-different +# 2 MB max size upload (2 * 1024 * 1024) +MAX_CONTENT_LENGTH=2097152 \ No newline at end of file diff --git a/backend/src/app.py b/backend/src/app.py index dff99a7..ada85e8 100644 --- a/backend/src/app.py +++ b/backend/src/app.py @@ -2,7 +2,7 @@ from flask_restful import Api from flask_jwt_extended import JWTManager from flask_cors import CORS -from flask_uploads import configure_uploads, patch_request_class +from flask_uploads import configure_uploads from marshmallow import ValidationError from src.libs.image_helper import IMAGE_SET @@ -18,7 +18,6 @@ app = Flask(__name__) app.config.from_object("src.settings.FlaskAppConfiguration") api = Api(app) -patch_request_class(app, 2 * 1024 * 1024) # 2 MB max size upload configure_uploads(app, IMAGE_SET) jwt = JWTManager(app) cors = CORS(app)