heroku / django / postgres django.db.utils.OperationalError:致命:主机没有pg_hba.conf条目...... SSL关闭

时间:2016-05-18 19:34:33

标签: django postgresql ssl heroku

我尝试从我的django应用程序连接到heroku postgres数据库时,在启动时遇到上述错误。这是我的Mac运行El Cap,10.11.5 - 似乎从我的笔记本电脑上工作正常,幸好还在运行Yosemite。我尝试升级所有东西 - python 2.7.11,最新的psycopg2和最新的Django。也许我需要咬紧牙关去蟒蛇3?它与heroku pg:psql连接得很好!这是整个堆栈。谢谢!

  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
    self.check_migrations()
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 163, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 176, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
    self.ensure_schema()
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
    if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 231, in cursor
    cursor = self.make_debug_cursor(self._cursor())
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 204, in _cursor
    self.ensure_connection()
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
    self.connect()
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 199, in ensure_connection
    self.connect()
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 171, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/django/db/backends/postgresql/base.py", line 175, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/Users/da/dev/pwapp/venv/lib/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: FATAL:  no pg_hba.conf entry for host "[ip]", user "", database "[yadda]", SSL off

0 个答案:

没有答案