mirror of
https://github.com/TrentSPalmer/flask_photo_scaling_app.git
synced 2025-09-05 02:51:33 -07:00
socket connection for postgresql
This commit is contained in:
@@ -8,6 +8,7 @@ def delete_photo(photo, app_config):
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
user=app_config['DATABASE_USER'],
|
||||
host="/var/run/postgresql",
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
|
@@ -9,6 +9,7 @@ def find_next_previous(photo, app_config):
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
user=app_config['DATABASE_USER'],
|
||||
host="/var/run/postgresql",
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
@@ -58,6 +59,7 @@ def get_photo_list(contributor_id, app_config):
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
user=app_config['DATABASE_USER'],
|
||||
host="/var/run/postgresql",
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
|
||||
|
@@ -13,6 +13,7 @@ def process_uploaded_photo(filename, current_user, app_config):
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
user=app_config['DATABASE_USER'],
|
||||
host="/var/run/postgresql",
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
|
@@ -7,6 +7,7 @@ def set_contributor_id_seq(app_config):
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
user=app_config['DATABASE_USER'],
|
||||
host="/var/run/postgresql",
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
|
||||
|
@@ -13,6 +13,7 @@ def get_totp_qr(contributor, app_config):
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
user=app_config['DATABASE_USER'],
|
||||
host="/var/run/postgresql",
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
@@ -32,6 +33,7 @@ def validate_totp(contributor, totp_code, app_config):
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
user=app_config['DATABASE_USER'],
|
||||
host="/var/run/postgresql",
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
@@ -47,6 +49,7 @@ def disable_2fa(contributor, app_config):
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
user=app_config['DATABASE_USER'],
|
||||
host="/var/run/postgresql",
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
|
Reference in New Issue
Block a user