Django南迁移AttributeError [英] Django South migration AttributeError
本文介绍了Django南迁移AttributeError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在Django(1.4)中迁移South(0.7.5)时遇到此错误.我最近将Timezone设置更改为false,即USE_TZ = False来解决另一个问题.有任何想法吗?谢谢
I'm suffering from this error when migrating South (0.7.5) in Django (1.4). I recently changed the Timezone setting to false, i.e. USE_TZ = False to fix another problem. Any ideas? Thanks
~/code/django/ssc/dev/ssc/ssc: python manage.py migrate crewcal
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/management/commands/migrate.py", line 105, in handle
ignore_ghosts = ignore_ghosts,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/__init__.py", line 158, in migrate_app
Migrations.calculate_dependencies()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/base.py", line 227, in calculate_dependencies
migration.calculate_dependencies()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/base.py", line 355, in calculate_dependencies
for migration in self._get_dependency_objects("depends_on"):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/base.py", line 335, in _get_dependency_objects
for app, name in getattr(self.migration_class(), attrname, []):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/base.py", line 307, in migration_class
return self.migration().Migration
AttributeError: 'module' object has no attribute 'Migration'
~/code/django/ssc/dev/ssc/ssc:
推荐答案
可能为时已晚,但我认为与TZ没有任何关系.
It may be too late, but I don't think it has anything to do with TZ.
每个迁移文件都具有如下声明:
Every migration file has a declaration like:
class Migration(SchemaMigration):
...
AttributeError
来自找不到声明的迁移类.
The AttributeError
comes from not finding this Migration class declared.
检查您所有的迁移是否都具有这样的迁移.否则,请提供更多详细信息.
Check whether all of your migrations have one like that. Otherwise please provide more details.
这篇关于Django南迁移AttributeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文