API - minor fix + update .env templates

This commit is contained in:
Sam 2021-07-17 12:33:11 +02:00
parent 8862368a71
commit 9254c02f1a
3 changed files with 14 additions and 14 deletions

View File

@ -13,17 +13,17 @@ export UPLOAD_FOLDER=/usr/src/app/uploads
# Database
export DATABASE_URL=postgresql://fittrackee:fittrackee@fittrackee-db:5432/fittrackee
export DATABASE_TEST_URL=postgresql://fittrackee:fittrackee@fittrackee-db:5432/fittrackee_test
export DATABASE_DISABLE_POOLING=
# export DATABASE_DISABLE_POOLING=
# Emails
export UI_URL=http://0.0.0.0:5000
export EMAIL_URL=smtp://none:none@mail:1025
export SENDER_EMAIL=fittrackee@example.com
export REDIS_URL=redis://redis:6379
# export REDIS_URL=redis://redis:6379
export WORKERS_PROCESSES=2
# Workouts
#export TILE_SERVER_URL=
#export MAP_ATTRIBUTION=
#export DEFAULT_STATICMAP=False
#export WEATHER_API_KEY=
# export TILE_SERVER_URL=
# export MAP_ATTRIBUTION=
# export DEFAULT_STATICMAP=False
# export WEATHER_API_KEY=

View File

@ -6,24 +6,24 @@
# export HOST=
# export PORT=
# export APP_SETTINGS=fittrackee.config.ProductionConfig
export APP_SECRET_KEY=
export APP_SECRET_KEY='please change me'
# export APP_WORKERS=
export APP_LOG=fittrackee.log
export UPLOAD_FOLDER=
# Database
# export DATABASE_URL=postgresql://fittrackee:fittrackee@${HOST}:5432/fittrackee
export DATABASE_DISABLE_POOLING=
# export DATABASE_DISABLE_POOLING=
# Emails
export UI_URL=
export EMAIL_URL=
export SENDER_EMAIL=
export REDIS_URL=
# export REDIS_URL=
# export WORKERS_PROCESSES=
# Workouts
export TILE_SERVER_URL=
export MAP_ATTRIBUTION=
#export DEFAULT_STATICMAP=False
export WEATHER_API_KEY=
# export TILE_SERVER_URL=
# export MAP_ATTRIBUTION=
# export DEFAULT_STATICMAP=False
# export WEATHER_API_KEY=

View File

@ -85,7 +85,7 @@ class ProductionConfig(BaseConfig):
# https://docs.sqlalchemy.org/en/13/core/pooling.html#using-connection-pools-with-multiprocessing-or-os-fork # noqa
SQLALCHEMY_ENGINE_OPTIONS = (
{'poolclass': NullPool}
if os.getenv('DATABASE_DISABLE_POOLING', False)
if os.getenv('DATABASE_DISABLE_POOLING', 'False') == 'True'
else {}
)
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')