Updating a Haystack search index with Django + Celery

前端 未结 4 522
醉梦人生
醉梦人生 2021-01-30 22:27

In my Django project I am using Celery. I switched over a command from crontab to be a periodic task and it works well but it is just calling a method on a model. Is it possible

4条回答
  •  爱一瞬间的悲伤
    2021-01-30 22:50

    As for version 2.0.0 beta of haystack, this code should work:

    from haystack.management.commands import update_index
    update_index.Command().handle(using='default')
    

提交回复
热议问题