English 中文(简体)
采用Django+Celery而不使用`celeryd'?
原标题:Developing with Django+Celery without running `celeryd`?

在发展过程中,它有一条管理<条码>celeryd的斜体,还有Django开发服务器。 例如,能否在发展过程中要求<条码>celery执行同步的任务? 或某种类似情况?

最佳回答

Yes you can do this by setting CELERY_TASK_ALWAYS_EAGER = True in your settings.
(Constant was previously called CELERY_ALWAYS_EAGER) http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-execution-settings

问题回答

There s also a custom Django test runner in django-celery that helps with CELERY_ALWAYS_EAGER. Read more about using Celery with Django on the docs.

http://www.ohchr.org。 由<代码>CELERY_TASK_ALWAYS_EAERT取代,载于Django的<代码>.py或task_always_eager。 载于celery conf

由于文体组合从3.x到4.x的诸多变化分散在许多方面,我建议使用内在环境中的移徙工具。

来源:

Luckily you don’t have to manually change the files, as the celery upgrade settings --django program should do the right thing.

http://docs.celeryproject.org/en/latest/whatsnew-4.0.html#步-4-up levels-to-celery-4-0

在撰写了5年多的论文之后,我注意到了我开发的一种模式,能够帮助测试和促进发展——我认识到,如果我的食理工作围绕通常在<条码>米项目.impl一揽子计划中的常规沙迦功能而分清,情况会更好。 食宿任务可能含有一些严格的与陈列有关的逻辑,例如,使用分配锁,例如明确的再工业逻辑等。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签