|
@@ -1,4 +1,4 @@
|
|
|
-from flask import Flask,request,jsonify,render_template,send_file,Response,redirect,url_for
|
|
|
+from flask import Flask,request,jsonify,render_template,send_file,Response
|
|
|
import base64
|
|
|
from flask_bootstrap import Bootstrap
|
|
|
import sqlite3
|
|
@@ -13,89 +13,81 @@ import uuid
|
|
|
import sys
|
|
|
import os
|
|
|
from pathlib import Path
|
|
|
+import logging
|
|
|
+from flask_migrate import Migrate
|
|
|
+from config import Config
|
|
|
+from flask_sqlalchemy import SQLAlchemy
|
|
|
|
|
|
ALLOWED_EXTENSIONS = {'pdf'}
|
|
|
app = Flask(__name__)
|
|
|
+
|
|
|
+app.config.from_object(Config)
|
|
|
+db = SQLAlchemy(app)
|
|
|
+migrate = Migrate(app, db)
|
|
|
+
|
|
|
+from models import ReferenceFile, OriginalFile
|
|
|
+
|
|
|
CORS(app)
|
|
|
Bootstrap(app)
|
|
|
app.secret_key = '12345'
|
|
|
+
|
|
|
+
|
|
|
def allowed_file(filename):
|
|
|
return '.' in filename and \
|
|
|
filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
|
|
|
|
|
|
-@app.route('/upload_reference_ajax', methods=['GET', 'POST'])
|
|
|
+@app.route('/upload_reference', methods=['GET', 'POST'])
|
|
|
def upload_reference_file():
|
|
|
uu_id = uuid.uuid1()
|
|
|
- sqliteConnection = sqlite3.connect('baangt.db')
|
|
|
- cursor = sqliteConnection.cursor()
|
|
|
- print("Connected to SQLite")
|
|
|
- cursor.execute('''CREATE TABLE IF NOT EXISTS reference_file (
|
|
|
- UUID NOT NULL,
|
|
|
- reference_pdf_name NOT NULL,
|
|
|
- reference_pdf text NOT NULL,
|
|
|
- description text NOT NULL
|
|
|
- );''')
|
|
|
- query = """ INSERT INTO reference_file
|
|
|
- (UUID,reference_pdf_name,reference_pdf, description) VALUES (?,?,?,?)"""
|
|
|
#### POST REQUEST FOR UPLOAD, DELETE
|
|
|
if request.method == 'POST':
|
|
|
#### UPLOAD
|
|
|
if request.files:
|
|
|
- print('sdddssd')
|
|
|
desc = request.form['description']
|
|
|
+ regex = request.form['regex']
|
|
|
file_ref = request.files['reference']
|
|
|
files_json = [{'file_ref':file_ref.filename,'uuid':str(uu_id.int), 'desc':desc}]
|
|
|
- print(files_json)
|
|
|
- # print(allowed_file(file_orig.filename))
|
|
|
try:
|
|
|
if allowed_file(file_ref.filename):
|
|
|
blob_ref = base64.b64encode(file_ref.read())
|
|
|
- data_tuple = (str(uu_id.int),file_ref.filename,blob_ref,desc)
|
|
|
- cursor.execute(query,data_tuple)
|
|
|
- sqliteConnection.commit()
|
|
|
- cursor.close()
|
|
|
+ ref = ReferenceFile(
|
|
|
+ uuid=str(uu_id.int),
|
|
|
+ reference_pdf_name=file_ref.filename,
|
|
|
+ reference_pdf=blob_ref,
|
|
|
+ description=desc,
|
|
|
+ regex=regex)
|
|
|
+ db.session.add(ref)
|
|
|
+ db.session.commit()
|
|
|
return jsonify(files_json)
|
|
|
else:
|
|
|
return Response("All fields must be selected", status=400, mimetype='application/json')
|
|
|
- except Exception as e:
|
|
|
- exc_type, exc_obj, exc_tb = sys.exc_info()
|
|
|
- fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
|
|
- print(exc_type, fname, exc_tb.tb_lineno)
|
|
|
- print(e)
|
|
|
+ except Exception:
|
|
|
+ # exc_type, exc_obj, exc_tb = sys.exc_info()
|
|
|
+ # fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
|
|
+ # print(exc_type, fname, exc_tb.tb_lineno)
|
|
|
+ logging.error("Exception occurred", exc_info=True)
|
|
|
return Response("Error in uploading", status=400, mimetype='application/json')
|
|
|
#### DELETE
|
|
|
else:
|
|
|
uuid_value = request.json['uuid']
|
|
|
- print(str(uuid_value))
|
|
|
- sql = 'Delete from reference_file where UUID = "{}"'.format(str(uuid_value))
|
|
|
- print(sql)
|
|
|
- cursor.execute(sql)
|
|
|
- sqliteConnection.commit()
|
|
|
- return jsonify('') #Response("Deleted", mimetype='application/json')
|
|
|
+ ref = ReferenceFile.query.filter_by(uuid = uuid_value).one()
|
|
|
+ db.session.delete(ref)
|
|
|
+ db.session.commit()
|
|
|
+ return jsonify('')
|
|
|
#### GET REQUEST FOR GET RESULTS
|
|
|
else:
|
|
|
try:
|
|
|
- cursor.execute('Select UUID, reference_pdf_name, description from reference_file')
|
|
|
- db_data = [i for i in cursor.fetchall()]
|
|
|
- print(db_data)
|
|
|
- cursor.close()
|
|
|
- # print(db_data)
|
|
|
+ refs = ReferenceFile.query.all()
|
|
|
+ db_data = []
|
|
|
+ for ref in refs:
|
|
|
+ db_data.append((ref.uuid, ref.reference_pdf_name, ref.description))
|
|
|
+
|
|
|
return jsonify(db_data)
|
|
|
- except:
|
|
|
+ except Exception:
|
|
|
return jsonify('')
|
|
|
- # return render_template('index.html')
|
|
|
|
|
|
-@app.route('/update_reference_ajax', methods=['GET', 'POST'])
|
|
|
+@app.route('/update_reference', methods=['GET', 'POST'])
|
|
|
def update_reference_file():
|
|
|
-
|
|
|
- sqliteConnection = sqlite3.connect('baangt.db')
|
|
|
- cursor = sqliteConnection.cursor()
|
|
|
- print("Connected to SQLite")
|
|
|
-
|
|
|
- query = """ UPDATE reference_file
|
|
|
- SET reference_pdf_name = :name , reference_pdf = :file , description = :desc
|
|
|
- WHERE UUID = :uuid
|
|
|
- """
|
|
|
#### POST REQUEST FOR UPDATE
|
|
|
if request.method == 'POST':
|
|
|
if request.files:
|
|
@@ -104,46 +96,34 @@ def update_reference_file():
|
|
|
desc = request.form['desc']
|
|
|
file_ref = request.files['reference']
|
|
|
files_json = [{'file_ref':file_ref.filename,'uuid':str(uuid),'desc':desc}]
|
|
|
- # print(files_json)
|
|
|
- # print(allowed_file(file_orig.filename))
|
|
|
try:
|
|
|
if allowed_file(file_ref.filename):
|
|
|
blob_ref = base64.b64encode(file_ref.read())
|
|
|
- data_tuple = (file_ref.filename,blob_ref,str(uuid))
|
|
|
- data = {'name' : file_ref.filename, 'file' : blob_ref, 'desc' : desc, 'uuid' : str(uuid)}
|
|
|
- cursor.execute(query,data)
|
|
|
- sqliteConnection.commit()
|
|
|
- cursor.close()
|
|
|
+
|
|
|
+ ref = ReferenceFile.query.filter_by(uuid = uuid).one()
|
|
|
+ ref.reference_pdf_name = file_ref.filename
|
|
|
+ ref.reference_pdf = blob_ref
|
|
|
+ ref.description = desc
|
|
|
+ db.session.commit()
|
|
|
+
|
|
|
return jsonify(files_json)
|
|
|
else:
|
|
|
return Response("All fields must be selected", status=400, mimetype='application/json')
|
|
|
- except Exception as e:
|
|
|
- exc_type, exc_obj, exc_tb = sys.exc_info()
|
|
|
- fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
|
|
- print(exc_type, fname, exc_tb.tb_lineno)
|
|
|
- print(e)
|
|
|
+ except Exception:
|
|
|
+ # exc_type, exc_obj, exc_tb = sys.exc_info()
|
|
|
+ # fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
|
|
+ # print(exc_type, fname, exc_tb.tb_lineno)
|
|
|
+ logging.error("Exception occurred", exc_info=True)
|
|
|
return Response("Error in uploading", status=400, mimetype='application/json')
|
|
|
- except:
|
|
|
+ except Exception:
|
|
|
return Response("All fields must be selected", status=400, mimetype='application/json')
|
|
|
else:
|
|
|
return Response("Bad request", status=400, mimetype='application/json')
|
|
|
- # return render_template('index.html')
|
|
|
|
|
|
-@app.route('/upload_original_ajax', methods=['GET', 'POST'])
|
|
|
+
|
|
|
+@app.route('/upload_original', methods=['GET', 'POST'])
|
|
|
def upload_original_file():
|
|
|
uu_id = uuid.uuid1()
|
|
|
- sqliteConnection = sqlite3.connect('baangt.db')
|
|
|
- cursor = sqliteConnection.cursor()
|
|
|
- print("Connected to SQLite")
|
|
|
- cursor.execute('''CREATE TABLE IF NOT EXISTS original_file (
|
|
|
- UUID NOT NULL,
|
|
|
- original_pdf_name NOT NULL,
|
|
|
- original_pdf text NOT NULL,
|
|
|
- description text NOT NULL,
|
|
|
- reference_uuid NOT NULL
|
|
|
- );''')
|
|
|
- query = """ INSERT INTO original_file
|
|
|
- (UUID,original_pdf_name,original_pdf, description, reference_uuid) VALUES (?,?,?,?,?)"""
|
|
|
if request.method == 'POST':
|
|
|
if request.files:
|
|
|
try:
|
|
@@ -151,152 +131,142 @@ def upload_original_file():
|
|
|
ref_uuid = request.form['reference_uuid']
|
|
|
file_orig = request.files['original']
|
|
|
files_json = [{'file_orig':file_orig.filename,'uuid':str(uu_id.int), 'desc':desc, 'ref_uuid':ref_uuid}]
|
|
|
- print(files_json)
|
|
|
- # print(allowed_file(file_orig.filename))
|
|
|
- # try:
|
|
|
if allowed_file(file_orig.filename):
|
|
|
blob_orig = base64.b64encode(file_orig.read())
|
|
|
- data_tuple = (str(uu_id.int),file_orig.filename,blob_orig, desc, ref_uuid)
|
|
|
- cursor.execute(query,data_tuple)
|
|
|
- sqliteConnection.commit()
|
|
|
- cursor.close()
|
|
|
+ orig = OriginalFile(
|
|
|
+ uuid=str(uu_id.int),
|
|
|
+ original_pdf_name=file_orig.filename,
|
|
|
+ original_pdf=blob_orig,
|
|
|
+ description=desc,
|
|
|
+ uuid_ref=ref_uuid)
|
|
|
+ db.session.add(orig)
|
|
|
+ db.session.commit()
|
|
|
return jsonify(files_json)
|
|
|
else:
|
|
|
return Response("All fields must be selected", status=422, mimetype='application/json')
|
|
|
- except Exception as e:
|
|
|
- exc_type, exc_obj, exc_tb = sys.exc_info()
|
|
|
- fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
|
|
- print(exc_type, fname, exc_tb.tb_lineno)
|
|
|
- print(e)
|
|
|
+ except Exception:
|
|
|
+ # exc_type, exc_obj, exc_tb = sys.exc_info()
|
|
|
+ # fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
|
|
|
+ # print(exc_type, fname, exc_tb.tb_lineno)
|
|
|
+ logging.error("Exception occurred", exc_info=True)
|
|
|
return Response("All fields must be selected", status=422, mimetype='application/json')
|
|
|
else:
|
|
|
uuid_value = request.json['uuid']
|
|
|
- print(str(uuid_value))
|
|
|
- sql = 'Delete from original_file where UUID = "{}"'.format(str(uuid_value))
|
|
|
- print(sql)
|
|
|
- cursor.execute(sql)
|
|
|
- sqliteConnection.commit()
|
|
|
+ orig = OriginalFile.query.filter_by(uuid = uuid_value).one()
|
|
|
+ db.session.delete(orig)
|
|
|
+ db.session.commit()
|
|
|
return jsonify('')
|
|
|
else:
|
|
|
try:
|
|
|
- cursor.execute('Select UUID, original_pdf_name, description, reference_uuid from original_file')
|
|
|
- db_data = [i for i in cursor.fetchall()]
|
|
|
- print(db_data)
|
|
|
- cursor.close()
|
|
|
- # print(db_data)
|
|
|
+ origs = OriginalFile.query.all()
|
|
|
+ db_data = []
|
|
|
+ for orig in origs:
|
|
|
+ db_data.append((orig.uuid, orig.original_pdf_name, orig.description, orig.uuid_ref))
|
|
|
+
|
|
|
return jsonify(db_data)
|
|
|
- except:
|
|
|
+ except Exception:
|
|
|
return jsonify('')
|
|
|
- # return render_template('index.html')
|
|
|
+
|
|
|
|
|
|
@app.route('/comparison',methods=['POST', 'GET'])
|
|
|
def comparison_():
|
|
|
if request.method == 'GET':
|
|
|
try:
|
|
|
- root_dir = Path.cwd()
|
|
|
+ basedir = Path.cwd()
|
|
|
uuid1 = request.args.get('uuid1', None)
|
|
|
uuid2 = request.args.get('uuid2', None)
|
|
|
- print(uuid1,uuid2)
|
|
|
-
|
|
|
- sqliteConnection = sqlite3.connect('baangt.db')
|
|
|
- cursor = sqliteConnection.cursor()
|
|
|
|
|
|
- orig_sql = 'Select original_pdf from original_file where UUID = "{}"'.format(str(uuid1))
|
|
|
- cursor.execute(orig_sql)
|
|
|
- blob = cursor.fetchone()
|
|
|
- blob_orig = base64.b64decode(blob[0])
|
|
|
+ orig = OriginalFile.query.filter_by(uuid = uuid1).one()
|
|
|
+ blob = orig.original_pdf
|
|
|
+ blob_orig = base64.b64decode(blob)
|
|
|
|
|
|
- with open(root_dir.joinpath('temp', 'temp_orig.pdf'), 'wb') as f:
|
|
|
+ with open(basedir.joinpath('temp', 'temp_orig.pdf'), 'wb') as f:
|
|
|
f.write(blob_orig)
|
|
|
|
|
|
- ref_sql = 'Select reference_pdf from reference_file where UUID = "{}"'.format(str(uuid2))
|
|
|
- cursor.execute(ref_sql)
|
|
|
- blob = cursor.fetchone()
|
|
|
- blob_ref = base64.b64decode(blob[0])
|
|
|
+ ref = ReferenceFile.query.filter_by(uuid = uuid2).one()
|
|
|
+ blob = ref.reference_pdf
|
|
|
+ blob_ref = base64.b64decode(blob)
|
|
|
|
|
|
- with open(root_dir.joinpath('temp', 'temp_ref.pdf'), 'wb') as f:
|
|
|
+ with open(basedir.joinpath('temp', 'temp_ref.pdf'), 'wb') as f:
|
|
|
f.write(blob_ref)
|
|
|
|
|
|
|
|
|
- input_file1 = root_dir.joinpath('temp', 'temp_orig.pdf')
|
|
|
- input_file2 = root_dir.joinpath('temp', 'temp_ref.pdf')
|
|
|
+ input_file1 = Path() / 'temp' / 'temp_orig.pdf'
|
|
|
+ input_file2 = Path() / 'temp' / 'temp_ref.pdf'
|
|
|
|
|
|
output_file1 = Path() / 'output' / 'Original_file.pdf'
|
|
|
output_file2 = Path() / 'output' / 'Reference_file.pdf'
|
|
|
|
|
|
- print('Comparing files ', input_file1, ' and ', input_file2, '.....')
|
|
|
+ msg = 'Comparing files ' + str(input_file1) + ' and ' + str(input_file2) + '.....'
|
|
|
+ logging.info(msg)
|
|
|
|
|
|
- fullText1 = ""
|
|
|
-
|
|
|
- pdfFileObj = open(input_file1, 'rb')
|
|
|
+ pdf_file_obj = open(input_file1, 'rb')
|
|
|
|
|
|
#The pdfReader variable is a readable object that will be parsed
|
|
|
- pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
|
|
|
+ pdf_reader = PyPDF2.PdfFileReader(pdf_file_obj)
|
|
|
|
|
|
#discerning the number of pages will allow us to parse through all #the pages
|
|
|
- num_pages = pdfReader.numPages
|
|
|
+ num_pages = pdf_reader.numPages
|
|
|
count = 0
|
|
|
text = ""
|
|
|
pages1 = []
|
|
|
|
|
|
#The while loop will read each page
|
|
|
while count < num_pages:
|
|
|
- pageObj = pdfReader.getPage(count)
|
|
|
+ page_obj = pdf_reader.getPage(count)
|
|
|
count +=1
|
|
|
- temp = pageObj.extractText()
|
|
|
+ temp = page_obj.extractText()
|
|
|
text += temp
|
|
|
pages1.append(temp)
|
|
|
|
|
|
- fullText1 = text
|
|
|
- fullText1 = fullText1.replace('\n', ' ')
|
|
|
- fullText1 = fullText1.replace(' \n', ' ')
|
|
|
- fullText1 = re.sub(' +', ' ', fullText1)
|
|
|
+ full_text1 = text
|
|
|
+ full_text1 = full_text1.replace('\n', ' ')
|
|
|
+ full_text1 = full_text1.replace(' \n', ' ')
|
|
|
+ full_text1 = re.sub(' +', ' ', full_text1)
|
|
|
|
|
|
while True:
|
|
|
try:
|
|
|
- inz = fullText1.index('Seite')
|
|
|
- temp = ' '.join(fullText1[inz:].split()[:4])
|
|
|
- fullText1 = fullText1.replace(temp, '')
|
|
|
- except:
|
|
|
+ inz = full_text1.index('Seite')
|
|
|
+ temp = ' '.join(full_text1[inz:].split()[:4])
|
|
|
+ full_text1 = full_text1.replace(temp, '')
|
|
|
+ except Exception:
|
|
|
break
|
|
|
|
|
|
- fullText2 = ""
|
|
|
-
|
|
|
- pdfFileObj = open(input_file2, 'rb')
|
|
|
+ pdf_file_obj = open(input_file2, 'rb')
|
|
|
|
|
|
#The pdfReader variable is a readable object that will be parsed
|
|
|
- pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
|
|
|
+ pdf_reader = PyPDF2.PdfFileReader(pdf_file_obj)
|
|
|
|
|
|
#discerning the number of pages will allow us to parse through all #the pages
|
|
|
- num_pages = pdfReader.numPages
|
|
|
+ num_pages = pdf_reader.numPages
|
|
|
count = 0
|
|
|
text = ""
|
|
|
pages2 = []
|
|
|
|
|
|
#The while loop will read each page
|
|
|
while count < num_pages:
|
|
|
- pageObj = pdfReader.getPage(count)
|
|
|
+ page_obj = pdf_reader.getPage(count)
|
|
|
count +=1
|
|
|
- temp = pageObj.extractText()
|
|
|
+ temp = page_obj.extractText()
|
|
|
text += temp
|
|
|
pages2.append(temp)
|
|
|
|
|
|
|
|
|
- fullText2 = text
|
|
|
- fullText2 = fullText2.replace('\n', ' ')
|
|
|
- fullText2 = fullText2.replace(' \n', ' ')
|
|
|
- fullText2 = re.sub(' +', ' ', fullText2)
|
|
|
+ full_text2 = text
|
|
|
+ full_text2 = full_text2.replace('\n', ' ')
|
|
|
+ full_text2 = full_text2.replace(' \n', ' ')
|
|
|
+ full_text2 = re.sub(' +', ' ', full_text2)
|
|
|
|
|
|
while True:
|
|
|
try:
|
|
|
- inz = fullText2.index('Seite')
|
|
|
- temp = ' '.join(fullText2[inz:].split()[:4])
|
|
|
- fullText2 = fullText2.replace(temp, '')
|
|
|
- except:
|
|
|
+ inz = full_text2.index('Seite')
|
|
|
+ temp = ' '.join(full_text2[inz:].split()[:4])
|
|
|
+ full_text2 = full_text2.replace(temp, '')
|
|
|
+ except Exception:
|
|
|
break
|
|
|
|
|
|
- str1 = fullText1
|
|
|
- str2 = fullText2
|
|
|
+ str1 = full_text1
|
|
|
+ str2 = full_text2
|
|
|
|
|
|
delta = difflib.Differ().compare(str1.split(), str2.split())
|
|
|
# difflist = []
|
|
@@ -331,7 +301,7 @@ def comparison_():
|
|
|
for match in matches:
|
|
|
sen = one_text[match.a:match.a + match.size]
|
|
|
if len(sen) > 6:
|
|
|
- # print(sen)
|
|
|
+
|
|
|
one_final = one_final.replace(sen, ' ', 1)
|
|
|
two_final = two_final.replace(sen, ' ', 1)
|
|
|
|
|
@@ -342,11 +312,15 @@ def comparison_():
|
|
|
for match in matches:
|
|
|
sen = two_text[match.a:match.a + match.size]
|
|
|
if len(sen) > 6:
|
|
|
- # print(sen)
|
|
|
+
|
|
|
one_final = one_final.replace(sen, ' ', 1)
|
|
|
two_final = two_final.replace(sen, ' ', 1)
|
|
|
|
|
|
- print('Generating', output_file1, '.....')
|
|
|
+
|
|
|
+ msg = 'Generating ' + str(output_file1) + '.....'
|
|
|
+ logging.info(msg)
|
|
|
+
|
|
|
+
|
|
|
one_list = one_final.split()
|
|
|
|
|
|
doc1 = fitz.open(input_file1)
|
|
@@ -370,11 +344,13 @@ def comparison_():
|
|
|
for inst in text_instances:
|
|
|
highlight = page.addHighlightAnnot(inst)
|
|
|
break
|
|
|
- except:
|
|
|
+ except Exception:
|
|
|
pass
|
|
|
doc1.save(output_file1, garbage=4, deflate=True, clean=True)
|
|
|
|
|
|
- print('Generating', output_file2, '.....')
|
|
|
+
|
|
|
+ msg = 'Generating ' + str(output_file2) + '.....'
|
|
|
+ logging.info(msg)
|
|
|
two_list = two_final.split()
|
|
|
|
|
|
# for i, page in enumerate(pages1):
|
|
@@ -399,31 +375,30 @@ def comparison_():
|
|
|
for inst in text_instances:
|
|
|
highlight = page.addHighlightAnnot(inst)
|
|
|
break
|
|
|
- except:
|
|
|
+ except Exception:
|
|
|
pass
|
|
|
doc2.save(output_file2, garbage=4, deflate=True, clean=True)
|
|
|
- zipObj = ZipFile(root_dir.joinpath('output', 'output.zip'), 'w')
|
|
|
- zipObj.write(output_file1)
|
|
|
- zipObj.write(output_file2)
|
|
|
- zipObj.close()
|
|
|
- print('Finish')
|
|
|
- except Exception as e:
|
|
|
-
|
|
|
- print('error in comparison')
|
|
|
- print(e)
|
|
|
+ zip_obj = ZipFile(basedir.joinpath('output', 'output.zip'), 'w')
|
|
|
+ zip_obj.write(output_file1)
|
|
|
+ zip_obj.write(output_file2)
|
|
|
+ zip_obj.close()
|
|
|
+
|
|
|
+ msg = 'Finish'
|
|
|
+ logging.info(msg)
|
|
|
+ except Exception:
|
|
|
+ logging.error("Exception occurred", exc_info=True)
|
|
|
return Response("Error in Comparison", status=400, mimetype='application/json')
|
|
|
|
|
|
|
|
|
- return send_file(root_dir.joinpath('output', 'output.zip'), as_attachment=True)
|
|
|
+ return send_file(basedir.joinpath('output', 'output.zip'), as_attachment=True)
|
|
|
else:
|
|
|
- print('sss')
|
|
|
return Response("Bad Request", status=400, mimetype='application/json')
|
|
|
|
|
|
|
|
|
-
|
|
|
@app.route('/')
|
|
|
def index():
|
|
|
return render_template('default.html')
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
+ logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
|
|
|
app.run()
|