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 21:23:24 +02:00
|
|
|
import psycopg2, psycopg2.extras
|
2018-09-24 23:49:47 +02:00
|
|
|
|
|
|
|
def database_connection():
|
2018-09-25 01:03:49 +02:00
|
|
|
connection = psycopg2.connect("dbname={} user={} password={} host='{}'".format(DATABASE_NAME, DATABASE_USER, DATABASE_PASS, DATABASE_HOST), cursor_factory=psycopg2.extras.DictCursor)
|
2018-09-23 23:00:05 +02:00
|
|
|
|
|
|
|
return connection
|
|
|
|
|
2018-09-23 15:47:00 +02:00
|
|
|
# vim: set sw=4 ts=4 expandtab:
|