mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-11-10 16:55:45 +01:00
database.py: Use one line for psycopg2 imports
This commit is contained in:
parent
366ae25b8e
commit
d0ea62d2bd
@ -2,8 +2,7 @@ from config import DATABASE_NAME
|
|||||||
from config import DATABASE_USER
|
from config import DATABASE_USER
|
||||||
from config import DATABASE_PASS
|
from config import DATABASE_PASS
|
||||||
from config import DATABASE_HOST
|
from config import DATABASE_HOST
|
||||||
import psycopg2
|
import psycopg2, psycopg2.extras
|
||||||
import psycopg2.extras
|
|
||||||
|
|
||||||
def database_connection():
|
def database_connection():
|
||||||
connection = psycopg2.connect("dbname={} user={} password={} host='{}'".format(DATABASE_NAME, DATABASE_USER, DATABASE_PASS, DATABASE_HOST), cursor_factory=psycopg2.extras.DictCursor)
|
connection = psycopg2.connect("dbname={} user={} password={} host='{}'".format(DATABASE_NAME, DATABASE_USER, DATABASE_PASS, DATABASE_HOST), cursor_factory=psycopg2.extras.DictCursor)
|
||||||
|
Loading…
Reference in New Issue
Block a user