1

実行時に「psycopq2.OperationalError」が発生します: python manage.py syncdb. djangostack スクリプトでテストしたところ、postgresql サーバーは稼働しているようです。誰でもこれに出くわしますか?django のチュートリアルを読んでセットアップするだけです。フレームワークの完全な初心者... このフォーラムで同様の問題をたくさん見つけましたが、完全に一致するものはないようです... ありがとう!

Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/Applications/djangostack-1.2.5-0/apps/django/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/Applications/djangostack-1.2.5-0/apps/django/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Applications/djangostack-1.2.5-0/apps/django/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Applications/djangostack-1.2.5-0/apps/django/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/Applications/djangostack-1.2.5-0/apps/django/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/Applications/djangostack-1.2.5-0/apps/django/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 56, in handle_noargs
    cursor = connection.cursor()
  File "/Applications/djangostack-1.2.5-0/apps/django/lib/python2.6/site-packages/django/db/backends/__init__.py", line 75, in cursor
    cursor = self._cursor()
  File "/Applications/djangostack-1.2.5-0/apps/django/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 136, in _cursor
    self.connection = Database.connect(**conn_params)
psycopg2.OperationalError: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
4

1 に答える 1

0

To summarize the comments in an answer, the basic problem is that Bitami requires settings to be set in other files.

  1. The port must be set in djangostack-1.2.5-0/postgresql/scripts/ctl.sh

  2. Some other settings, including the username of postgres, get set in the settings.py so this may need to be changed as well.

于 2013-03-19T01:49:17.247 に答える