1
我剛開始使用南和現有的應用程序,並且在向數據庫添加新模型後,我可以在管理員中查看模型,但點擊它們以查看模型的細節錯誤Django South向管理員添加了模型,但給了DatabaseError
我嘗試做執行syncdb以南相當於:
python manage.py schemamigration directory --initial
python manage.py migrate directory
其中directory是應用程序的名稱。
所以,當我嘗試查看模型在管理我得到如下:
Exception Type: DatabaseError
Exception Value: (1146, "Table 'omada.directory_drift' doesn't exist")
其中漂移是我加入的models.py,然後在admin.py註冊的模型 - omada是網站名稱。
更多信息:
從Django的網站回溯結束與:當執行
python manage.py migrate directory
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py" in execute
114. return self.cursor.execute(query, args) File "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.4b5-py2.7-linux-i686.egg/MySQLdb/cursors.py" in execute
201. self.errorhandler(self, exc, value) File "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.4b5-py2.7-linux-i686.egg/MySQLdb/connections.py" in defaulterrorhandler
36. raise errorclass, errorvalue
我取得開頭的錯誤:
FATAL ERROR - The following SQL query failed: CREATE TABLE `directory_building`
! Since you have a database that does not support running
! schema-altering statements in transactions, we have had
! to leave it in an interim state between migrations.
不健全的非常有前途的:S,並與結束:
File "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.4b5-py2.7-linux-i686.egg/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.DatabaseError: (1050, "Table 'directory_building' already exists")
在此先感謝大家誰花時間閱讀,並提供幫助!