回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我刚看过一个关于django的教程,我遵循了每一步,但每次尝试迁移时都会出现以下错误:</p>
<p>最初的迁移是可行的,但是尝试迁移时,我得到了这样的结果:</p>
<pre><code> root@debian:/Sites/tumblog# ./manage.py migrate blog
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/lib/pymodules/python2.6/south/management/commands/migrate.py", line 102, in handle
delete_ghosts = delete_ghosts,
File "/usr/lib/pymodules/python2.6/south/migration/__init__.py", line 202, in migrate_app
success = migrator.migrate_many(target, workplan, database)
File "/usr/lib/pymodules/python2.6/south/migration/migrators.py", line 215, in migrate_many
result = migrator.__class__.migrate_many(migrator, target, migrations, database)
File "/usr/lib/pymodules/python2.6/south/migration/migrators.py", line 284, in migrate_many
result = self.migrate(migration, database)
File "/usr/lib/pymodules/python2.6/south/migration/migrators.py", line 121, in migrate
result = self.run(migration)
File "/usr/lib/pymodules/python2.6/south/migration/migrators.py", line 95, in run
return self.run_migration(migration)
File "/usr/lib/pymodules/python2.6/south/migration/migrators.py", line 77, in run_migration
migration_function()
File "/usr/lib/pymodules/python2.6/south/migration/migrators.py", line 56, in <lambda>
return (lambda: direction(orm))
File "/Site/tumblog/blog/migrations/0005_initial.py", line 17, in forwards
('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
File "/usr/lib/pymodules/python2.6/south/db/generic.py", line 210, in create_table
', '.join([col for col in columns if col]),
File "/usr/lib/pymodules/python2.6/south/db/generic.py", line 134, in execute
cursor.execute(sql, params)
File "/usr/lib/pymodules/python2.6/django/db/backends/util.py", line 15, in execute
return self.cursor.execute(sql, params)
File "/usr/lib/pymodules/python2.6/django/db/backends/mysql/base.py", line 86, in execute
return self.cursor.execute(query, args)
File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 166, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 35, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1050, "Table 'blog_blog' already exists")
</code></pre>
<p>我搜索了一下,发现添加--fake可以跳过这个错误,但它不会改变任何事情?这里的问题是什么?我如何解决它?在</p>