1

我一直在尝试安装 celery 几天,我面临的问题是。当我尝试做 manage.py syncd 。我收到错误消息。

C:\o\17\mysite>manage.py syncdb
Error: No module named djcelery

当我已经使用 easy_install 成功安装了 celery

 C:\o\17\mysite>easy_install django-celery
 Searching for django-celery
 Best match: django-celery 3.0.17
 Processing django_celery-3.0.17-py2.6.egg
 django-celery 3.0.17 is already the active version in easy-install.pth
 Installing djcelerymon script to C:\Python26\Scripts
 Installing djcelerymon-script.py script to C:\Python26\Scripts
 Installing djcelerymon.exe script to C:\Python26\Scripts
 Installing djcelerymon.exe.manifest script to C:\Python26\Scripts

 Using c:\python26\lib\site-packages\django_celery-3.0.17-py2.6.egg
      Processing dependencies for django-celery
 Finished processing dependencies for django-celery

我已经设置了我正在使用的 django 数据库的代理。

BROKER_URL = 'django://'

我将 djcelery 添加到 installed_app

INSTALLED_APPS = (
    'django.contrib.auth',

    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'pet',
        'kombu.transport.django',
'djcelery ',
)

我还在我的 setting.py 中添加了以下几行

 import djcelery
 djcelery.setup_loader()

我以前有安装 django 插件的经验,我只是不明白为什么这不会让我在 cmd 上同步数据库

我究竟做错了什么?有人可以帮帮我吗 :)

4

2 回答 2

1

尝试:

INSTALLED_APPS = (
    'django.contrib.auth',

    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'pet',
    'kombu.transport.django',
    'djcelery ',
)
于 2013-05-11T06:43:59.770 回答
1

djcelery我认为问题在于in末尾的空格字符INSTALLED_APPS。尝试删除它并syncdb再次运行。希望有帮助。

于 2013-05-11T09:45:40.287 回答