diff options
Diffstat (limited to 'vsearch4web.py')
| -rw-r--r-- | vsearch4web.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vsearch4web.py b/vsearch4web.py index 3eed663..db44936 100644 --- a/vsearch4web.py +++ b/vsearch4web.py @@ -1,20 +1,19 @@ from flask import Flask, render_template, request, escape from vsearch import search4letters - -from DBcm import UseDatabase +import mysql.connector app = Flask(__name__) -app.config['dbconfig'] = {'host': '127.0.0.1', - 'user': 'vsearch', - 'password': 'vsearchpasswd', - 'database': 'vsearchlogDB', } +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(app.config['dbconfig']) as cursor: + with UseDatabase(dbconfig) as cursor: _SQL = """insert into log (phrase, letters, ip, browser_string, results) values |
