Remove hardcoded values

This commit is contained in:
norohind 2021-11-28 02:36:52 +03:00
parent b5d0c43b7e
commit 089451745c
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1
2 changed files with 6 additions and 7 deletions

View File

@ -7,8 +7,6 @@ logger = get_main_logger()
env_choose = os.getenv('DB_NAME')
env_choose = 'sqlite' # TODO: remove
if env_choose == 'postgres':
logger.info('Using postgres DB')
from .import postgres_model as model

View File

@ -1,4 +1,5 @@
import json
import os
import sqlite3
import typing
@ -14,11 +15,11 @@ logger = get_main_logger()
logger.propagate = False
db: psycopg2.extensions.connection = psycopg2.connect(
user='user2',
password='1',
host='192.168.1.68',
port='5432',
database='test0',
user=os.environ['DB_USERNAME'], # user2
password=os.environ['DB_PASSWORD'], # 1
host=os.environ['DB_HOSTNAME'], # 192.168.1.68
port=os.environ['DB_PORT'], # 5432
database=os.environ['DB_DATABASE'], # test0
cursor_factory=psycopg2.extras.DictCursor)
with db: