-1
您好我已經開發了我的項目在本地的機器,但我已經轉移其生產成一臺服務器,我收到以下錯誤:Django的NodeNotFoundError執行syncdb時
python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 25, in handle
call_command("migrate", **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 120, in call_command
return command.execute(*args, **defaults)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 321, in build_graph
_reraise_missing_dependency(migration, parent, e)
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/loader.py", line 291, in _reraise_missing_dependency
raise exc
django.db.migrations.graph.NodeNotFoundError: Migration MYapp.0010_auto_20160415_1815 dependencies reference nonexistent parent node (u'registration', u'0003_migrate_activatedstatus')
我剛剛從一個複製我的項目機器到另一個。我的Django版本是1.8.11 任何人有任何想法? 感謝
以任何機會你創造一些對這些遷移過Django 1.8的早期版本?在我的一個項目中,我看到了一些類似的項目,其中遷移可以使用1.8.0,然後在1.8.2或更高版本中突然崩潰,然後突然再次開始工作。可能想要嘗試讓它在本地工作,然後在執行任何操作之前爲所有內容生成一個squash_migration。 – Paul
Paul感謝您的回覆。我想我已經找到了我的問題...我已經從生產中刪除了舊的遷移文件,然後再次運行它...所以現在它正在工作 – Paul85
恭喜您解決問題,對未來而言,很可能您的錯誤是由不同的在你的開發(新版本)和生產(舊版本)軟件包上的'django-registration'版本。 爲了避免出現這樣的錯誤,請儘量保留帶有版本號列出的所有依賴關係的'requirements.txt'文件 - 以便能夠在相同版本中具有相同的依賴關係 - 當然還有virtualenv :) – Jerzyk