我正在開發一個新的Django項目,並且正在關注this tutorial。我在一步「使用南爲數據庫遷移」,試圖運行python manage.py syncdb
,和我得到了以下錯誤:在一個新的Django項目中設置南的錯誤
(editorial)[[email protected] editorial (master *)]$ python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/django/core/management/__init__.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/south/management/commands/__init__.py", line 13, in <module>
from south.management.commands.syncdb import Command as SyncCommand
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/south/management/commands/syncdb.py", line 18, in <module>
from south import migration
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/south/migration/__init__.py", line 11, in <module>
from south.models import MigrationHistory
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/south/models.py", line 4, in <module>
class MigrationHistory(models.Model):
File "/Users/hookedonwinter/.virtualenvs/editorial/lib/python2.6/site-packages/django/db/models/base.py", line 97, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
TypeError: Error when calling the metaclass bases
__init__() keywords must be strings
這裏是我的settings.py文件:https://gist.github.com/pjhoberman/5273653
有沒有應用程序,只是一個空的項目。我猜這是我的一個簡單忽略 - 任何想法?
編輯
從評論:
我沒有任何的模型呢。接下來的教程,我想在做任何模型工作之前先從南開始。
版本:
- Django的== 1.5.1
- 南== 0.7.6
如果我在settings.py南註釋掉,我得到這個錯誤:
$ python manage.py syncdb
TypeError: Error when calling the metaclass bases __init__() keywords must be strings
EDIT2
我開始了和使用的Django 1.4,和它的作品。
EDIT3
我更新的python 2.7和使用的Django 1.5,這一切工作爲好。
可以分享模型嗎?在模型初始化的過程中可能會有些微不足道的錯誤 – karthikr
看起來他沒有定義任何模型或定製應用程序。 Django/South的哪個版本? –
在'INSTALLED_APPS'中評論'south'然後運行syncdb會得到錯誤? – iMom0