From 69d42de7ea76db5d166b7a112a13de61c27528a2 Mon Sep 17 00:00:00 2001 From: Nico von Geyso Date: Mon, 21 May 2012 13:09:15 +0200 Subject: set file upload limit to 10mb --- app.py | 4 ++-- settings.py | 3 +++ static/upload.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 settings.py diff --git a/app.py b/app.py index 6b96cae..114da0c 100644 --- a/app.py +++ b/app.py @@ -8,7 +8,7 @@ from werkzeug import secure_filename fit = Fit('static/fit.git') app = Flask(__name__) -app.secret_key = 'naidiequ8zies1weed4we6iexood1Bae' +app.config.from_object('settings') ALLOWED_EXTENSIONS = set( ['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif', 'zip', 'gs', 'gz' ]) @@ -89,4 +89,4 @@ def index(): if __name__ == "__main__": - app.run(debug=True) + app.run() diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..6c91281 --- /dev/null +++ b/settings.py @@ -0,0 +1,3 @@ +SECRET_KEY = 'secret_key_to_fill_in' +MAX_CONTENT_LENGTH = 10 * 1024 * 1024 +DEBUG = False diff --git a/static/upload.js b/static/upload.js index 3a6d0ca..48f5581 100644 --- a/static/upload.js +++ b/static/upload.js @@ -46,7 +46,7 @@ fileUploader.init = function() { '' + - '' + + '' + '' + ''); }); -- cgit v1.2.3-1-g7c22