Add celery prefix for configuration (#1676)

* Add celery prefix for configuration

* Update CONTRIBUTORS.rst
This commit is contained in:
Denis Orehovsky 2018-06-21 22:39:19 +03:00 committed by Nikita Shupeyko
parent 07060eaecc
commit 83b5f00ac5
2 changed files with 5 additions and 1 deletions

View File

@ -87,6 +87,7 @@ Listed in alphabetical order.
David Díaz `@ddiazpinto`_ @DavidDiazPinto
Davur Clementsen `@dsclementsen`_ @davur
Delio Castillo `@jangeador`_ @jangeador
Denis Orehovsky `@apirobot`_
Dónal Adams `@epileptic-fish`_
Dong Huynh `@trungdong`_
Emanuel Calso `@bloodpet`_ @bloodpet
@ -172,6 +173,7 @@ Listed in alphabetical order.
.. _@amjith: https://github.com/amjith
.. _@andor-pierdelacabeza: https://github.com/andor-pierdelacabeza
.. _@antoniablair: https://github.com/antoniablair
.. _@apirobot: https://github.com/apirobot
.. _@archinal: https://github.com/archinal
.. _@areski: https://github.com/areski
.. _@arruda: https://github.com/arruda

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)