2011-09-28 63 views
0

我面臨的一個錯誤而執行python manage.py suncdb錯誤,當我執行執行syncdb

誤差

C:\Python25\lib\site-packages\django\conf\__init__.py:75: DeprecationWarning: Th 
e ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead. 
    "use STATIC_URL instead.", DeprecationWarning) 
C:\Python25\lib\site-packages\django\contrib\localflavor\ca\ca_provinces.py:14: 
RuntimeWarning: There have been recent changes to the CA localflavor. See the re 
lease notes for details 
    RuntimeWarning 
Creating tables ... 
Traceback (most recent call last): 
    File "manage.py", line 14, in <module> 
    execute_manager(settings) 
    File "C:\Python25\lib\site-packages\django\core\management\__init__.py", line 
442, in execute_manager 
    utility.execute() 
    File "C:\Python25\lib\site-packages\django\core\management\__init__.py", line 
379, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "C:\Python25\lib\site-packages\django\core\management\base.py", line 191, 
in run_from_argv 
    self.execute(*args, **options.__dict__) 
    File "C:\Python25\lib\site-packages\django\core\management\base.py", line 220, 
in execute 
    output = self.handle(*args, **options) 
    File "C:\Python25\lib\site-packages\django\core\management\base.py", line 351, 
in handle 
    return self.handle_noargs(**options) 
    File "C:\Python25\lib\site-packages\django\core\management\commands\syncdb.py" 
, line 109, in handle_noargs 
    emit_post_sync_signal(created_models, verbosity, interactive, db) 
    File "C:\Python25\lib\site-packages\django\core\management\sql.py", line 189, 
in emit_post_sync_signal 
    interactive=interactive, db=db) 
    File "C:\Python25\lib\site-packages\django\dispatch\dispatcher.py", line 172, 
in send 
    response = receiver(signal=self, sender=sender, **named) 
    File "C:\Python25\lib\site-packages\django\contrib\contenttypes\management.py" 
, line 47, in update_contenttypes 
    content_type_display = '\n'.join([' %s | %s' % (ct.app_label, ct.model) f 
or ct in content_types]) 
AttributeError: 'unicode' object has no attribute 'app_label' 

,我試圖轉換數據庫和所有的表和字段排序規則utf8_general_ci但沒有改變

回答

0

該錯誤說明你有一個字符串,而不是Model Meta選項。這可能與整理無關。

在出現錯誤之前您做了哪些更改?

+0

感謝raacer,我只是遷移網站,得到了最近的數據庫備份和文件,到本地,但它給了我這個錯誤。 –

+0

你使用什麼樣的django版本,以前使用過什麼版本?看來你有Python 2.5,它是否對應於你從原來的Python版本遷移? – raacer

+0

如果你不確定,我建議將你的python升級到最新的2.x版本,看看是否仍然出現錯誤。 – raacer

0

我有這個問題,我剛剛刪除了數據庫,並重新運行syncdb,它很好。