Example #1
0
from sqlalchemy.sql.expression import and_
from util.util import wsgi_print
from local_config import UPLOAD_DIR, LOG_FILE
from util.validator import StringValidator

app = Flask(__name__)


def init_db():
    from db import db

    db.create_all()


# dir config
app.config["upload_dir"] = os.path.join(os.getcwd(), UPLOAD_DIR)
app.config["samples_dir"] = os.path.join(os.getcwd(), "static/uploads")

# --- logs ---#

if not app.debug:
    import logging
    from logging import FileHandler

    file_handler = FileHandler(LOG_FILE)
    file_handler.setLevel(logging.WARNING)
    app.logger.addHandler(file_handler)


def init_app():
    """