欢迎光临散文网 会员登陆 & 注册

How to rightly integrate celery into Django

2023-07-03 21:37 作者:目标力扣Knight  | 我要投稿

django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured.

official document:


the steps to solve problems:

  • compare with teacher’s configuration

  • revise previous notes.

  • seek for configuration in official document website.

  • change the source of configuration to single file.

  • after startup, upgrade variable names based on official document

I found that if I replace the variable, which is currently written in uppercase as `CELERY`, with a lowercase variable in version 6.0, I won't be able to use the configuration attribute in `app.config_from_object('django.conf:settings', namespace='CELERY')`. As a result, I will only be able to use a single file to configure settings for Celery.

Afterwards, I restored the configuration in the active settings of Django and clicked on the function definition.

I discovered that I can create the settings for Celery on my own. Here is the function definition: `celery.app.base.Celery.config_from_object`.


the original configuration:

 


Successful.


How to rightly integrate celery into Django的评论 (共 条)

分享到微博请遵守国家法律