Spaces:
seosnaps
/
Runtime error

seosnaps commited on
Commit
ad07929
1 Parent(s): ff7d7e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -1,4 +1,4 @@
1
- from flask import Flask, request, send_from_directory
2
  import os
3
 
4
  app = Flask(__name__)
@@ -9,7 +9,13 @@ if not os.path.exists(UPLOAD_FOLDER):
9
 
10
  app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
11
 
 
12
  @app.route('/', methods=['GET', 'POST'])
 
 
 
 
 
13
  def upload_file():
14
  if request.method == 'POST':
15
  if 'file' not in request.files:
 
1
+ from flask import Flask, request, send_from_directory,abort
2
  import os
3
 
4
  app = Flask(__name__)
 
9
 
10
  app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
11
 
12
+
13
  @app.route('/', methods=['GET', 'POST'])
14
+ def home():
15
+ abort(500, "Server Error")
16
+
17
+
18
+ @app.route('/upload', methods=['GET', 'POST'])
19
  def upload_file():
20
  if request.method == 'POST':
21
  if 'file' not in request.files: