From 084f713dd781c2a42e0ee3870b92481164eb1e4a Mon Sep 17 00:00:00 2001 From: mdmujtabaraza <45493966+mdmujtabaraza@users.noreply.github.com> Date: Tue, 31 Aug 2021 18:22:30 +0530 Subject: [PATCH] Fixed #18, reference->'https://stackoverflow.com/a/67114549' --- backend/.env.example | 4 +++- backend/src/app.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) 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)