rpi-rgb/app/__init__.py
Finn Christiansen a45e61856b
All checks were successful
Python formatting PEP8 / Pyhton-PEP8 (push) Successful in 16s
CSS Linter / CSS-Lint (push) Successful in 32s
Javascript Linter / Javascript-Lint (push) Successful in 12s
🐛 fix create_app factory
2023-06-09 20:06:31 +02:00

21 lines
599 B
Python

from flask import Flask
from config import config
def create_app(config_name='development'):
app = Flask(__name__)
from .index import index_blueprint
from .color import color_blueprint
app.register_blueprint(index_blueprint)
app.register_blueprint(color_blueprint)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
@app.cli.command()
def test():
"""Run the unit tests."""
import unittest
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(tests)
return app