2011-12-12 96 views
3
存在

。根據djcelery表,Django的芹菜的documentation,如果我有南方我應該叫創建具有南

python manage.py migrate djcelery 

然而,它的作用是創造一些遷移文件:

Running migrations for djcelery: 
- Migrating forwards to 0001_initial 
> djcelery:0001_initial 
- Loading initial data for djcelery. 
No fixtures found. 

它不會像它應該做的那樣創建下列表格。我也從INSTALLED_APPS南取出後執行syncdb:

Creating table djcelery_intervalschedule 
Creating table djcelery_crontabschedule 
Creating table djcelery_periodictasks 
Creating table djcelery_periodictask 
Creating table djcelery_workerstate 
Creating table djcelery_taskstate 

然而,當南存在,這些表不與

python manage.py syncdb 

奇怪的創建是,不知爲什麼昨天我能得到這些表與syncdb,但我真的不知道我做了什麼,使其工作,並不能重現它。在Windows 7和Ubuntu 11.10上都會發生這種情況

我想知道如果我做錯了。任何輸入將不勝感激!

回答

0

似乎djcelery失敗默默如果表已經存在:看https://github.com/ask/django-celery/blob/master/djcelery/migrations/0001_initial.py

您可以嘗試修補遷移和打印異常消息。它可能有幫助。

編輯:可能您可以嘗試使用以下編輯0001_initial.py中的ignore_exists。 (好吧不是很乾淨,但它可能有助於瞭解)

def ignore_exists(fun, *args, **kwargs): 
    try: 
     fun(*args, **kwargs) 
    except DatabaseError, exc: 
     print "##", exC#This is the patch 
     if "exists" in str(exc): 
      return False 
     raise 
    return True 
+0

嗨,呂克,感謝您的回覆!如果可能的話,你能準確地描述應該採取的步驟嗎? (即修補和打印異常消息。) – airfang

+0

嗨airfang,看我的更新 – luc

3

我們有同樣的問題,並能獲得通過--all標誌安裝與南非創建的所有表與syncdb

python manage.py syncdb --all 
-1

只要運行這個命令,我最近使用它並創建了所有的djcelery表。

python manage.py migrate