2024-08-26 13:37:58 +00:00
|
|
|
from flask import Flask
|
2024-08-26 15:21:25 +00:00
|
|
|
from config import get_config
|
|
|
|
from .errors import register_error_handlers
|
2024-08-26 13:37:58 +00:00
|
|
|
|
2024-08-26 15:21:25 +00:00
|
|
|
def create_app():
|
2024-08-26 13:37:58 +00:00
|
|
|
app = Flask(__name__)
|
2024-08-26 15:21:25 +00:00
|
|
|
config = get_config()
|
|
|
|
app.config.from_object(config)
|
|
|
|
config.init_app(app)
|
2024-08-26 13:37:58 +00:00
|
|
|
|
2024-08-26 15:21:25 +00:00
|
|
|
from . import routes
|
2024-08-26 13:37:58 +00:00
|
|
|
app.register_blueprint(routes.bp)
|
|
|
|
|
2024-08-26 15:21:25 +00:00
|
|
|
register_error_handlers(app) # Make sure this line is present
|
|
|
|
|
2024-08-26 13:37:58 +00:00
|
|
|
return app
|