January 2018
Intermediate to advanced
366 pages
9h 7m
English
Just as we did in our microservices with Flask before, this microservice also has a settings file, config.py. The point of attention is because we do not have configurations for access to the database. Let's take a look at the following example:
class BaseConfig:
"""Base configuration"""
DEBUG = False
TESTING = False
class DevelopmentConfig(BaseConfig):
"""Development configuration"""
DEBUG = True
class TestingConfig(BaseConfig):
"""Testing configuration"""
DEBUG = True
TESTING = True
class ProductionConfig(BaseConfig):
"""Production configuration"""
DEBUG = False
Read now
Unlock full access