1

Heroku を使用して最初の実際の Web サイトをデプロイしようとしています。過去に一度、超シンプルなサイトでデプロイに成功したことがありますが、今回は行き詰まっているようです。サイトをローカルで正常に実行できます。

Heroku で Deploy for Free をクリックすると、アプリの作成、環境の構成、およびアプリのビルドが正常に行われます。このエラーは、Run scripts & scale dynos の部分から発生し、「postdeploy exit code was not 0」というメッセージが表示されます

プロジェクトを開始するために、 Django 1.9.4 とcookiecutter-djangoを使用しています。また、プロジェクトに鶺鴒を追加し、かなり単純なページをいくつか作成しました。私の他のファイルを見る必要がある場合は、お知らせください。私はこれで途方に暮れています。

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: relation "django_content_type" does not exist
LINE 1: ..."."app_label", "django_content_type"."model" FROM "django_co...

                                                             ^



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


Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.5/site-packages/django/contrib/contenttypes/models.py", line 67, in get_for_model
    ct = self.get(app_label=opts.app_label, model=opts.model_name)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/models/manager.py", line 122, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/models/query.py", line 381, in get
    num = len(clone)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/models/query.py", line 240, in __len__
    self._fetch_all()
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/models/query.py", line 1074, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/models/query.py", line 52, in __iter__
    results = compiler.execute_sql()
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 848, in execute_sql
    cursor.execute(sql, params)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "django_content_type" does not exist
LINE 1: ..."."app_label", "django_content_type"."model" FROM "django_co...

                                                             ^



During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/base.py", line 398, in execute
    self.check()
  File "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/base.py", line 426, in check
    include_deployment_checks=include_deployment_checks,
  File "/app/.heroku/python/lib/python3.5/site-packages/django/core/checks/registry.py", line 75, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/app/.heroku/python/lib/python3.5/site-packages/django/core/checks/model_checks.py", line 28, in check_all_models
    errors.extend(model.check(**kwargs))
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailcore/models.py", line 572, in check
    if not issubclass(edit_handler.get_form_class(cls), WagtailAdminPageForm):
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 294, in get_form_class
    formsets=cls.required_formsets(),
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 240, in required_formsets
    formsets.update(handler_class.required_formsets())
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 240, in required_formsets
    formsets.update(handler_class.required_formsets())
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 603, in required_formsets
    'widgets': child_edit_handler_class.widget_overrides(),
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 216, in widget_overrides
    widgets.update(handler_class.widget_overrides())
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 216, in widget_overrides
    widgets.update(handler_class.widget_overrides())
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 516, in widget_overrides
    content_type=cls.target_content_type(), can_choose_root=cls.can_choose_root)}
  File "/app/.heroku/python/lib/python3.5/site-packages/wagtail/wagtailadmin/edit_handlers.py", line 543, in target_content_type
    cls._target_content_type = [ContentType.objects.get_for_model(target_model)]
  File "/app/.heroku/python/lib/python3.5/site-packages/django/contrib/contenttypes/models.py", line 80, in get_for_model
    "Error creating new content types. Please make sure contenttypes "
RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.
4

2 に答える 2

1

次を使用して移行コマンドを実行する必要がある場合があります。

heroku run python manage.py migrate
于 2016-04-01T00:17:17.277 に答える
1

Wagtail 1.4.3 にまだアップグレードしていない場合は、アップグレードしてみてください。最新のリリースでは、プロジェクト データベースをゼロから作成する際の問題がいくつか修正されています。

于 2016-04-09T09:25:48.083 に答える