| Conditions | 2 |
| Total Lines | 16 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import os |
||
| 7 | def create_app(config_module=None): |
||
| 8 | app = Flask(__name__) |
||
| 9 | app.config.from_object(config_module or |
||
| 10 | os.environ.get('FLASK_CONFIG') or |
||
| 11 | 'config') |
||
| 12 | celery.config_from_object(app.config) |
||
| 13 | |||
| 14 | db.init_app(app) |
||
| 15 | |||
| 16 | from api.v1_0 import api as api_blueprint |
||
| 17 | app.register_blueprint(api_blueprint, url_prefix='/api/v1.0') |
||
| 18 | |||
| 19 | if app.config['USE_TOKEN_AUTH']: |
||
| 20 | from api.token import token as token_blueprint |
||
| 21 | app.register_blueprint(token_blueprint, url_prefix='/auth') |
||
| 22 | return app |
||
| 23 | |||
| 24 |