Add celery prefix for configuration

This commit is contained in:
Denis Orehovsky 2018-06-06 15:41:23 +03:00
parent 911e822e85
commit c1759c707a

View File

@ -20,7 +20,9 @@ class CeleryAppConfig(AppConfig):
def ready(self):
# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('django.conf:settings')
# - namespace='CELERY' means all celery-related configuration keys
# should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')
installed_apps = [app_config.name for app_config in apps.get_app_configs()]
app.autodiscover_tasks(lambda: installed_apps, force=True)