mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-01-12 08:44:46 +00:00
Enables config items to be set via environment variables
This commit is contained in:
parent
e5d02e4015
commit
b3ef4eac87
@ -1,9 +1,20 @@
|
||||
import os
|
||||
from os import environ
|
||||
|
||||
basedir = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
NAME = "CR Connect Protocol Builder Mock"
|
||||
CORS_ENABLED = False
|
||||
DEVELOPMENT = True
|
||||
TESTING = False
|
||||
SQLALCHEMY_DATABASE_URI = "postgresql://crc_user:crc_pass@localhost:5432/pb"
|
||||
SECRET_KEY = 'a really really really really long secret key'
|
||||
DEVELOPMENT = bool(eval(environ.get('DEVELOPMENT', default="True")))
|
||||
TESTING = bool(eval(environ.get('TESTING', default="False")))
|
||||
|
||||
DB_HOST = environ.get('DB_HOST', default="localhost")
|
||||
DB_PORT = environ.get('DB_PORT', default="5432")
|
||||
DB_NAME = environ.get('DB_NAME', default="pb")
|
||||
DB_USER = environ.get('DB_USER', default="crc_user")
|
||||
DB_PASSWORD = environ.get('DB_PASSWORD', default="crc_pass")
|
||||
SQLALCHEMY_DATABASE_URI = environ.get(
|
||||
'SQLALCHEMY_DATABASE_URI',
|
||||
default="postgresql://%s:%s@%s:%s/%s" % (DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME)
|
||||
)
|
||||
SECRET_KEY = environ.get('SECRET_KEY', default='a really really really really long secret key')
|
||||
|
Loading…
x
Reference in New Issue
Block a user