Update celery environ and tasks

This commit is contained in:
Wayne Witzel III
2017-11-09 17:21:19 -05:00
parent de376292ba
commit 14c5123fda
6 changed files with 61 additions and 28 deletions

23
awx/celery.py Normal file
View File

@@ -0,0 +1,23 @@
# Copyright (c) 2017 Ansible, Inc.
# All Rights Reserved.
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
try:
import awx.devonly # noqa
MODE = 'development'
except ImportError: # pragma: no cover
MODE = 'production'
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'awx.settings.%s' % MODE)
app = Celery('awx')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
if __name__ == '__main__':
app.start()