summaryrefslogtreecommitdiff
path: root/vsearch4web.py
diff options
context:
space:
mode:
Diffstat (limited to 'vsearch4web.py')
-rw-r--r--vsearch4web.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/vsearch4web.py b/vsearch4web.py
index db44936..3eed663 100644
--- a/vsearch4web.py
+++ b/vsearch4web.py
@@ -1,19 +1,20 @@
from flask import Flask, render_template, request, escape
from vsearch import search4letters
-import mysql.connector
+
+from DBcm import UseDatabase
app = Flask(__name__)
-dbconfig = {'host': '127.0.0.1',
- 'user': 'vsearch',
- 'password': 'vsearchpasswd',
- 'database': 'vsearchlogDB', }
+app.config['dbconfig'] = {'host': '127.0.0.1',
+ 'user': 'vsearch',
+ 'password': 'vsearchpasswd',
+ 'database': 'vsearchlogDB', }
def log_request(req: 'flask_request', res: str) -> None:
"""Log details of the web request and the results."""
- with UseDatabase(dbconfig) as cursor:
+ with UseDatabase(app.config['dbconfig']) as cursor:
_SQL = """insert into log
(phrase, letters, ip, browser_string, results)
values