gpt4 book ai didi

python - 异常消息 : What does it mean? - django 1.8 python 3.4 - python manage.py makemigrate

转载 作者:行者123 更新时间:2023-12-01 04:38:30 24 4
gpt4 key购买 nike

这是错误消息:不确定异常消息的含义是什么。另外,我在运行本地服务器时似乎没有收到任何错误。那么它将来会抛出任何错误吗?

(proj1) C:\Users\vetri\Google Drive\proj1\src>python manage.py mak
emigrations
No changes detected

(proj1) C:\Users\vetri\Google Drive\proj1\src>python manage.py mig
rate
Operations to perform:
Synchronize unmigrated apps: messages, staticfiles
Apply all migrations: contenttypes, sessions, admin, Index, auth
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying Index.0001_initial...Traceback (most recent call last):
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\bac
kends\utils.py", line 62, in execute
return self.cursor.execute(sql)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\bac
kends\sqlite3\base.py", line 316, in execute
return Database.Cursor.execute(self, query)
sqlite3.OperationalError: table "Index_usermanagement" already exists

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\core\m
anagement\__init__.py", line 338, in execute_from_command_line
utility.execute()
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\core\m
anagement\__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\core\m
anagement\base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\core\m
anagement\base.py", line 441, in execute
output = self.handle(*args, **options)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\core\m
anagement\commands\migrate.py", line 221, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\mig
rations\executor.py", line 110, in migrate
self.apply_migration(states[migration], migration, fake=fake, fake_initial=f
ake_initial)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\mig
rations\executor.py", line 147, in apply_migration
state = migration.apply(state, schema_editor)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\mig
rations\migration.py", line 115, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, projec
t_state)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\mig
rations\operations\models.py", line 59, in database_forwards
schema_editor.create_model(model)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\bac
kends\base\schema.py", line 286, in create_model
self.execute(sql, params or None)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\bac
kends\base\schema.py", line 111, in execute
cursor.execute(sql, params)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\bac
kends\utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\bac
kends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\uti
ls.py", line 97, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\utils\
six.py", line 658, in reraise
raise value.with_traceback(tb)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\bac
kends\utils.py", line 62, in execute
return self.cursor.execute(sql)
File "C:\Users\vetri\Google Drive\proj1\lib\site-packages\django\db\bac
kends\sqlite3\base.py", line 316, in execute
return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: table "Index_usermanagement" already exists

(proj1) C:\Users\vetri\Google Drive\proj1\src>

最佳答案

在进行迁移之前,您必须运行syncdb,否则可能的原因是使用已经具有此表的数据库的其他版本尝试删除已经存在的表“Index_usermanagement”!之后再次运行

python manage.py migrate

关于python - 异常消息 : What does it mean? - django 1.8 python 3.4 - python manage.py makemigrate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31278053/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com