예제 #1
0
    def __init__(self, config_file):
        super().__init__(config_file)

    def get_redis_settings(self):
        try:
            return self.configuration["redis_cache_settings"]
        except KeyError:
            raise Exception(
                'The  redis configurations are not configured, please configure in yml file'
            )


r = RedisUtils()
config = RedisConfigurationReader('./conf/redis_settings.yml')
config.read_config_file()
r.strict_connect(**config.get_redis_settings())
print(r.__dict__)

app = Flask(__name__)

example_blueprint = Blueprint("example_blueprint", __name__)

app.config['SWAGGER'] = {
    "swagger_version":
    "2.0",
    "title":
    "Flasgger",
    "headers": [
        ('Access-Control-Allow-Origin', '*'),
        ('Access-Control-Allow-Methods', "GET, POST, PUT, DELETE, OPTIONS"),
        ('Access-Control-Allow-Credentials', "true"),