gpt4 book ai didi

Django 南迁移 AttributeError

转载 作者:行者123 更新时间:2023-12-05 01:27:38 29 4
gpt4 key购买 nike

在 Django (1.4) 中迁移 South (0.7.5) 时,我遇到了这个错误。我最近将时区设置更改为 false,即 USE_TZ = False 以解决另一个问题。有任何想法吗?谢谢

~/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没有任何关系。

每个迁移文件都有如下声明:

class Migration(SchemaMigration):
...
AttributeError来自未找到声明的此迁移类。

检查您的所有迁移是否都有这样的迁移。否则,请提供更多详细信息。

关于Django 南迁移 AttributeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10826532/

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