English 中文(简体)
celery-django能够找到环境
原标题:celery-django can t find settings

我有一个Django项目,利用Celery执行非同步任务。 我在视窗XP机器上做我的开发。

开始使用我的Django服务器(python管理)。 pyprserver 80 工作罚款,但试图开始Celeery Daemon(python管理)。 粉碎的开端有以下错误:

ImportError: 进口环境可能不会rc。 (它是否涉及玩具?) 是否有yn错? 没有任何称为rc的模块。

sys.path, 包括C:development SpaceCorpsrc ,因此,我无法确定它为何不能找到这一模块。

从开始全部产出:

C:developmentSpaceCorpssrc>python manage.py celeryd start
[2010-07-23 18:29:31,456: WARNING/MainProcess] ?[1;33mcelery@mike-laptop v2.0.1 is starting.?[0m
[2010-07-23 18:29:31,456: WARNING/MainProcess] ?[1;33mC:Program FilesPython26libsite-packagescelery-2.0.1-py2.6.eggceleryinceleryd.py:206: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in a production environment!
  warnings.warn("Using settings.DEBUG leads to a memory leak, "?[0m
[2010-07-23 18:29:31,456: WARNING/MainProcess] ?[1;33mConfiguration ->
    . broker -> amqp://guest@localhost:5672/
    . queues ->
    . celery -> exchange:celery (direct) binding:celery
    . concurrency -> 2
    . loader -> djcelery.loaders.DjangoLoader
    . logfile -> [stderr]@WARNING
    . events -> OFF
    . beat -> OFF?[0m
[2010-07-23 18:29:31,706: WARNING/MainProcess] ?[1;33mcelery@mike-laptop has started.?[0m
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:Program FilesPython26libmultiprocessingforking.py", line 342, in main
    self = load(from_parent)
  File "C:Program FilesPython26libpickle.py", line 1370, in load
    return Unpickler(file).load()
  File "C:Program FilesPython26libpickle.py", line 858, in load
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    dispatch[key](self)
  File "C:Program FilesPython26libpickle.py", line 1090, in load_global
  File "C:Program FilesPython26libmultiprocessingforking.py", line 342, in main
    self = load(from_parent)
  File "C:Program FilesPython26libpickle.py", line 1370, in load
    klass = self.find_class(module, name)
  File "C:Program FilesPython26libpickle.py", line 1124, in find_class
    return Unpickler(file).load()
  File "C:Program FilesPython26libpickle.py", line 858, in load
    dispatch[key](self)
  File "C:Program FilesPython26libpickle.py", line 1090, in load_global
    __import__(module)
  File "C:Program FilesPython26libsite-packagescelery-2.0.1-py2.6.eggceleryconcurrencyprocesses\__init__.py", line 7, in <module>
    from celery import log
  File "C:Program FilesPython26libsite-packagescelery-2.0.1-py2.6.eggcelerylog.py", line 8, in <module>
    from celery import conf
  File "C:Program FilesPython26libsite-packagescelery-2.0.1-py2.6.eggceleryconf.py", line 118, in <module>
    ALWAYS_EAGER = _get("CELERY_ALWAYS_EAGER")
  File "C:Program FilesPython26libsite-packagescelery-2.0.1-py2.6.eggceleryconf.py", line 109, in _get
    value = getattr(settings, alias)
  File "c:developmentdjangodjangoutilsfunctional.py", line 276, in __getattr__
    self._setup()
  File "c:developmentdjangodjangoconf\__init__.py", line 40, in _setup
    self._wrapped = Settings(settings_module)
  File "c:developmentdjangodjangoconf\__init__.py", line 75, in __init__
    raise ImportError("Could not import settings  %s  (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings  src.settings  (Is it on sys.path? Does it have syntax errors?): No module named src.settings
最佳回答
问题回答

sys.path must include C:developmentSpaceCorps not C:developmentSpaceCorpssrc , because he is looking for src.settings, not just settings.





相关问题
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 ]="...