mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-02 02:40:35 +00:00
Add postgresql database
This commit is contained in:
14
config.py
14
config.py
@ -24,8 +24,16 @@ class Config:
|
||||
|
||||
class DevelopmentConfig(Config):
|
||||
DEBUG = True
|
||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir,
|
||||
'data_dev.sqlite')
|
||||
# SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir,
|
||||
# 'data_dev.sqlite')
|
||||
SQLALCHEMY_DATABASE_URI = \
|
||||
'postgresql+psycopg2://{user}:{passwd}@{host}:{port}/{db}'.format(
|
||||
user=os.environ.get('POSTGRES_USER'),
|
||||
passwd=os.environ.get('POSTGRES_PASSWORD'),
|
||||
host=os.environ.get('POSTGRES_HOST'),
|
||||
port=os.environ.get('POSTGRES_PORT'),
|
||||
db=os.environ.get('POSTGRES_DB_NAME'))
|
||||
print(SQLALCHEMY_DATABASE_URI)
|
||||
|
||||
|
||||
class TestingConfig(Config):
|
||||
@ -41,7 +49,7 @@ class TestingConfig(Config):
|
||||
config = {
|
||||
'development': DevelopmentConfig,
|
||||
'testing': TestingConfig,
|
||||
# 'production': ProductionConfig,
|
||||
#'production': ProductionConfig,
|
||||
|
||||
'default': DevelopmentConfig
|
||||
}
|
||||
|
Reference in New Issue
Block a user