2018-10-26 18:14:27 +02:00
|
|
|
from .config import DATABASE_NAME
|
|
|
|
from .config import DATABASE_USER
|
|
|
|
from .config import DATABASE_PASS
|
|
|
|
from .config import DATABASE_HOST
|
2018-09-26 22:23:24 +03:00
|
|
|
import psycopg2, psycopg2.extras
|
2018-09-25 00:49:47 +03:00
|
|
|
|
|
|
|
def database_connection():
|
2018-09-25 02:03:49 +03:00
|
|
|
connection = psycopg2.connect("dbname={} user={} password={} host='{}'".format(DATABASE_NAME, DATABASE_USER, DATABASE_PASS, DATABASE_HOST), cursor_factory=psycopg2.extras.DictCursor)
|
2018-09-24 00:00:05 +03:00
|
|
|
|
|
|
|
return connection
|
|
|
|
|
2018-09-23 16:47:00 +03:00
|
|
|
# vim: set sw=4 ts=4 expandtab:
|