Allow connection string to be overridden by environment variable
Remove NullPool left over from using sqlite
This commit is contained in:
parent
4a47c78a1a
commit
bd75ecc6ef
@ -13,11 +13,12 @@ from sqlalchemy.dialects.postgresql import BYTEA
|
|||||||
from sqlalchemy.exc import IntegrityError
|
from sqlalchemy.exc import IntegrityError
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
from sqlalchemy.orm import scoped_session, sessionmaker
|
from sqlalchemy.orm import scoped_session, sessionmaker
|
||||||
from sqlalchemy.pool import NullPool
|
|
||||||
from sqlalchemy.sql.expression import cast
|
from sqlalchemy.sql.expression import cast
|
||||||
from werkzeug.security import check_password_hash
|
from werkzeug.security import check_password_hash
|
||||||
|
|
||||||
engine = create_engine("***REMOVED***", poolclass=NullPool)
|
DB_URL = os.environ.get("CONNECTION_STRING", "***REMOVED***")
|
||||||
|
|
||||||
|
engine = create_engine(DB_URL)
|
||||||
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)
|
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)
|
||||||
session_factory = sessionmaker(bind=engine)
|
session_factory = sessionmaker(bind=engine)
|
||||||
Session = scoped_session(session_factory)
|
Session = scoped_session(session_factory)
|
||||||
|
Loading…
Reference in New Issue
Block a user