1

Heroko 配置

DATABASE_URL:                 postgres://xxxxxxxx:xxxxxxxxxx@ec2-54-243-215-140.compute-1.amazonaws.com:5432/xxxxxxxxx
HEROKU_POSTGRESQL_GOLD_URL:   postgres://yyyyyyyyyyy:yyyyyyyyyyyyy@ec2-54-243-243-20.compute-1.amazonaws.com:5432/yyyyyyyyyy
HEROKU_POSTGRESQL_YELLOW_URL: postgres://zzzzzzzzzz:zzzzzzzzzzzz@ec2-54-243-215-140.compute-1.amazonaws.com:5432/zzzzzzzzz

设置.py

DATABASES = {'default': dj_database_url.config(default='postgres://xxxxxxxx:xxxxxxxxxx@ec2-54-243-215-140.compute-1.amazonaws.com:5432/xxxxxxxxx'),}

heroku 运行 python manage.py syncdb

Running `python manage.py syncdb` attached to terminal... up, run.4673
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 60, in handle_noargs
    tables = connection.introspection.table_names()
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/__init__.py", line 910, in table_names
    return self.get_table_list(cursor)
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/introspection.py", line 33, in get_table_list
    AND pg_catalog.pg_table_is_visible(c.oid)""")
  File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
    return self.cursor.execute(query, args)
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block

许多人不会说英语,因此无法解释。有什么问题?

4

1 回答 1

0

您发布的错误仅表示交易中存在先前的错误并且交易已经中止。您无法通过解决此错误来解决此问题。你必须找出你真正的问题是什么并尝试解决它。

为此,请检查您的 PostgreSQL 日志,并从该错误开始向后搜索,直到您遇到不同的错误。那将是终止交易的错误,您可以改为修复该错误。但是,从故障排除的角度来看,此错误毫无意义。找到你真正的问题并解决它。

于 2013-04-26T02:50:41.547 回答