mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-10 06:54:52 +03:00
Add celery prefix for configuration
This commit is contained in:
parent
911e822e85
commit
c1759c707a
|
@ -20,7 +20,9 @@ class CeleryAppConfig(AppConfig):
|
||||||
def ready(self):
|
def ready(self):
|
||||||
# Using a string here means the worker will not have to
|
# Using a string here means the worker will not have to
|
||||||
# pickle the object when using Windows.
|
# 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()]
|
installed_apps = [app_config.name for app_config in apps.get_app_configs()]
|
||||||
app.autodiscover_tasks(lambda: installed_apps, force=True)
|
app.autodiscover_tasks(lambda: installed_apps, force=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user