EAN13generator/main.py

36 lines
786 B
Python
Raw Normal View History

2020-07-12 23:07:56 +00:00
from flask import Flask, render_template, request
from datetime import datetime
import re
import fnmatch
import os
import meinheld
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = "./dataset/"
app.config['MAX_CONTENT_LENGTH'] = 10000000000 # 10GB
# Return our beautiful Bootstrap webpage. That we totally have.
@app.route('/')
def upload():
2020-07-13 00:28:11 +00:00
return render_template('index.html')
2020-07-12 23:07:56 +00:00
# What happens when someone uploads a thingy
2020-07-13 00:28:11 +00:00
@app.route('/upload', methods=['POST'])
2020-07-12 23:07:56 +00:00
def upload_file():
if request.method == 'POST':
f = request.files['file']
2020-07-12 23:31:02 +00:00
2020-07-12 23:07:56 +00:00
2020-07-13 00:28:11 +00:00
2020-07-12 23:07:56 +00:00
# Return success webpage
2020-07-12 23:31:02 +00:00
return render_template('successful.html')
2020-07-12 23:07:56 +00:00
else:
# No POST Found
return render_template('error.html')
if __name__ == '__main__':
app.run()