| Conditions | 1 |
| Total Lines | 15 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 28 | 1 | def create_app(config, database): |
|
| 29 | """ |
||
| 30 | Create app |
||
| 31 | """ |
||
| 32 | |||
| 33 | # app initialization |
||
| 34 | 1 | app = Flask(__name__) |
|
| 35 | |||
| 36 | 1 | app.config.from_object(config) |
|
| 37 | |||
| 38 | # db initialization |
||
| 39 | 1 | database.init_app(app) |
|
| 40 | |||
| 41 | # database.create_all(app=app) when use need to re-initialize db |
||
| 42 | 1 | return app |
|
| 43 | |||
| 71 |