From 0b95a0277813ce0916bcb8d7d39596c4f24c4fc0 Mon Sep 17 00:00:00 2001 From: Pablo <42.pablo.ms@gmail.com> Date: Mon, 13 Jul 2020 02:28:11 +0200 Subject: [PATCH] Lean --- main.py | 18 +++------- templates/base.html | 32 +++--------------- templates/index.html | 13 ++++++++ templates/upload.html | 78 ------------------------------------------- 4 files changed, 22 insertions(+), 119 deletions(-) create mode 100644 templates/index.html delete mode 100644 templates/upload.html diff --git a/main.py b/main.py index 3fa952f..21e8569 100644 --- a/main.py +++ b/main.py @@ -10,31 +10,21 @@ app = Flask(__name__) app.config['UPLOAD_FOLDER'] = "./dataset/" app.config['MAX_CONTENT_LENGTH'] = 10000000000 # 10GB -meinheld.set_max_content_length(100*1024*1024) # Return our beautiful Bootstrap webpage. That we totally have. @app.route('/') def upload(): - return render_template('upload.html') - -# What happens when the files just don't fit -@app.errorhandler(413) -def request_entity_too_large(error): - return 'File Too Thicc', 413 - -# What happens when we did an oopsie -@app.errorhandler(500) -def internal_server_error(error): - return render_template('error.html') + return render_template('index.html') # What happens when someone uploads a thingy -@app.route('/uploader', methods=['POST']) +@app.route('/upload', methods=['POST']) def upload_file(): if request.method == 'POST': f = request.files['file'] - + + # Return success webpage return render_template('successful.html') else: diff --git a/templates/base.html b/templates/base.html index 6df3f10..9506a0e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -14,43 +14,21 @@ - + - - - + + +
- -