summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorLenczu Vex <kuba.lenczowski03@gmail.com>2025-04-05 12:22:31 +0200
committerLenczu Vex <kuba.lenczowski03@gmail.com>2025-04-05 12:23:44 +0200
commite0f8c7b78b58f18d73bed4310f99d4fb1ebb5508 (patch)
tree8891fde19df169fb6853a081d1364bec60336ce6 /main.py
parent10905ea5ae9945fd5ae7b90a1cdfa083fd3fbdd1 (diff)
Swapped db to postgresqlHEADmaster
Diffstat (limited to 'main.py')
-rw-r--r--main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.py b/main.py
index 8ead667..1fa7768 100644
--- a/main.py
+++ b/main.py
@@ -1,5 +1,5 @@
from flask import Flask, request, render_template, redirect, make_response
-import mariadb
+import psycopg2
import argon2
import tomllib as toml
import secrets
@@ -68,18 +68,18 @@ def login():
page = request.args.get("page")
username = request.form.get("username")
password = request.form.get("password")
- mariadb_connection = mariadb.connect(
+ psycopg2_connection = psycopg2.connect(
user=app.config["DB_USER"],
password=app.config["DB_PASSWORD"],
host=app.config["DB_HOST"],
port=app.config["DB_PORT"],
database=app.config["DB_NAME"],
)
- cur = mariadb_connection.cursor()
+ cur = psycopg2_connection.cursor()
cur.execute("SELECT password FROM users WHERE username = ?", (username,))
result = cur.fetchone()
cur.close()
- mariadb_connection.close()
+ psycopg2_connection.close()
if result is None:
return render_template("login.html", error="Invalid username or password"), 401