Commit 795ad74c authored by mouadh's avatar mouadh

change connection settings

parent f26b5713
import psycopg2 as pg import psycopg2 as pg
# postgres connection
USERNAME = 'postgres'
PASSWORD = 'root'
HOST = 'localhost'
class MyDB(object): class MyDB(object):
"""Connect to sql database (postgres only right now).""" """Connect to sql database (postgres only right now)."""
def __init__(self, def __init__(self,
username='postgres', username=USERNAME,
password='root', password=PASSWORD,
db=None, db=None,
host='localhost'): host=HOST):
if db is None: if db is None:
self.connection = pg.connect( self.connection = pg.connect(
"user={0} password={1}".format(username, password)) "user={0} password={1}".format(username, password))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment