init_elasticsearch.py 578 Bytes
Newer Older
崔为之's avatar
崔为之 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version     : Python 3.11.4
# @Software    : Sublime Text 4
# @Author      : StudentCWZ
# @Email       : StudentCWZ@outlook.com
# @Date        : 2023/10/28 18:16
# @File        : init_elasticsearch.py
# @Description :
"""


from flask import Flask

崔为之's avatar
崔为之 committed
16
from application.libs import FlaskElasticsearch
崔为之's avatar
崔为之 committed
17 18 19 20 21 22 23 24 25 26 27 28

es = FlaskElasticsearch()


def init_elasticsearch(app: Flask) -> None:
    """
    Initialize the flask_elasticsearch extension

    :param app: flask.Flask application instance
    :return: None
    """
    es.init_app(app)