我一直在尝试安装芹菜几天,而我遇到的问题是。当我尝试做manage.py syncd时。我收到了错误消息。
C:\o\17\mysite>manage.py syncdb
Error: No module named djcelery
当我使用easy_install
成功安装芹菜时 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上同步dbdb
我做错了什么?有人可以帮助我:))
答案 0 :(得分: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 ',
)
答案 1 :(得分:1)
我认为问题在于djcelery
INSTALLED_APPS
末尾的空格字符。尝试删除它并再次运行syncdb
。希望有所帮助。