wenzhuo zhan
commited on
Commit
·
01b9866
1
Parent(s):
236885d
issue 341_Update __init__.py (#344)
Browse files### What problem does this PR solve?
Issue link:#341
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- api/apps/__init__.py +4 -3
api/apps/__init__.py
CHANGED
@@ -15,6 +15,7 @@
|
|
15 |
#
|
16 |
import logging
|
17 |
import sys
|
|
|
18 |
from importlib.util import module_from_spec, spec_from_file_location
|
19 |
from pathlib import Path
|
20 |
from flask import Blueprint, Flask, request
|
@@ -53,8 +54,8 @@ app.errorhandler(Exception)(server_error_response)
|
|
53 |
#app.config["LOGIN_DISABLED"] = True
|
54 |
app.config["SESSION_PERMANENT"] = False
|
55 |
app.config["SESSION_TYPE"] = "filesystem"
|
56 |
-
app.config['MAX_CONTENT_LENGTH'] = 128 * 1024 * 1024
|
57 |
-
|
58 |
Session(app)
|
59 |
login_manager = LoginManager()
|
60 |
login_manager.init_app(app)
|
@@ -116,4 +117,4 @@ def load_user(web_request):
|
|
116 |
|
117 |
@app.teardown_request
|
118 |
def _db_close(exc):
|
119 |
-
close_connection()
|
|
|
15 |
#
|
16 |
import logging
|
17 |
import sys
|
18 |
+
import os
|
19 |
from importlib.util import module_from_spec, spec_from_file_location
|
20 |
from pathlib import Path
|
21 |
from flask import Blueprint, Flask, request
|
|
|
54 |
#app.config["LOGIN_DISABLED"] = True
|
55 |
app.config["SESSION_PERMANENT"] = False
|
56 |
app.config["SESSION_TYPE"] = "filesystem"
|
57 |
+
#app.config['MAX_CONTENT_LENGTH'] = 128 * 1024 * 1024
|
58 |
+
app.config['MAX_CONTENT_LENGTH'] = os.environ.get("MAX_CONTENT_LENGTH", 128 * 1024 * 1024)
|
59 |
Session(app)
|
60 |
login_manager = LoginManager()
|
61 |
login_manager.init_app(app)
|
|
|
117 |
|
118 |
@app.teardown_request
|
119 |
def _db_close(exc):
|
120 |
+
close_connection()
|