from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from config import Config

app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)

login = LoginManager(app)
login.login_view = 'login'
login.login_message = "Veuillez vous authentifier avant de continuer."

from app import models  # IDK why this is here, but it works
from app.routes import index, search, users  # To load routes at initialization
from app.routes.account import login, account
from app.routes.admin import index, groups, account, trophies
from app.utils import pluralize  # To use pluralize into the templates
