[conf] fix HALFAPI_PROD variable that is set to a string

This commit is contained in:
Maxime Alves LIRMM 2021-09-03 16:38:20 +02:00
parent 51877b271e
commit 55109e271c
3 changed files with 1 additions and 14 deletions

View File

@ -113,6 +113,6 @@ class HalfAPI:
starlette_app=self.application)
)
logger.info('CONFIG:\n%s', CONFIG)
application = HalfAPI().application

View File

@ -135,8 +135,6 @@ except FileNotFoundError as exc:
PRODUCTION = config.getboolean('project', 'production',
fallback=environ.get('HALFAPI_PROD', False))
os.environ['HALFAPI_PROD'] = str(PRODUCTION)
LOGLEVEL = config.get('project', 'loglevel',
fallback=environ.get('HALFAPI_LOGLEVEL', 'info')).lower()

View File

@ -24,17 +24,6 @@ from starlette.exceptions import HTTPException
logger = logging.getLogger('halfapi')
"""
@OLD : old way to check production setting, we can simply check app's "debug" attribute
try:
from ..conf import PRODUCTION
except ImportError:
logger.warning('Could not import PRODUCTION variable from conf module,'\
' using HALFAPI_PROD environment variable')
PRODUCTION = bool(environ.get('HALFAPI_PROD', False))
"""
try:
from ..conf import SECRET
except ImportError as exc: