Refactoring finished :-)
eveai_workers now working (with errors ;-) ) Remote debugging now available
This commit is contained in:
33
eveai_workers/__init__.py
Normal file
33
eveai_workers/__init__.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import logging
|
||||
import logging.config
|
||||
from flask import Flask
|
||||
|
||||
from common.utils.celery_utils import make_celery, init_celery
|
||||
from common.extensions import db
|
||||
from config.logging_config import LOGGING
|
||||
|
||||
|
||||
def create_app(config_file=None):
|
||||
app = Flask(__name__)
|
||||
|
||||
if config_file is None:
|
||||
app.config.from_object('config.config.DevConfig')
|
||||
else:
|
||||
app.config.from_object(config_file)
|
||||
|
||||
logging.config.dictConfig(LOGGING)
|
||||
register_extensions(app)
|
||||
|
||||
celery = make_celery(app.name, app.config)
|
||||
init_celery(celery, app)
|
||||
|
||||
from . import tasks
|
||||
|
||||
return app, celery
|
||||
|
||||
|
||||
def register_extensions(app):
|
||||
db.init_app(app)
|
||||
|
||||
|
||||
app, celery = create_app()
|
||||
Reference in New Issue
Block a user