mirror of
https://github.com/TrentSPalmer/flask_photo_scaling_app.git
synced 2024-12-22 02:32:50 -08:00
add DATABASE_HOST config parameter
This commit is contained in:
parent
9885d3190c
commit
c2ccb01aab
@ -8,7 +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",
|
||||
host=app_config['DATABASE_HOST'],
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
|
@ -9,7 +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",
|
||||
host=app_config['DATABASE_HOST'],
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
@ -59,7 +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",
|
||||
host=app_config['DATABASE_HOST'],
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
|
||||
|
@ -13,7 +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",
|
||||
host=app_config['DATABASE_HOST'],
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
|
@ -7,7 +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",
|
||||
host=app_config['DATABASE_HOST'],
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
|
||||
|
@ -13,7 +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",
|
||||
host=app_config['DATABASE_HOST'],
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
@ -33,7 +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",
|
||||
host=app_config['DATABASE_HOST'],
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
@ -49,7 +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",
|
||||
host=app_config['DATABASE_HOST'],
|
||||
password=app_config['DATABASE_PASSWORD']
|
||||
)
|
||||
cur = conn.cursor()
|
||||
|
@ -14,6 +14,7 @@ class Config(object):
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
DATABASE_NAME = os.environ.get('DATABASE_NAME')
|
||||
DATABASE_USER = os.environ.get('DATABASE_USER')
|
||||
DATABASE_HOST = os.environ.get('DATABASE_HOST')
|
||||
DATABASE_PASSWORD = os.environ.get('DATABASE_PASSWORD')
|
||||
|
||||
LOGGING_XMPP_SERVER = os.environ.get('LOGGING_XMPP_SERVER')
|
||||
|
Loading…
Reference in New Issue
Block a user