這是我在我的Django項目中的settings.py文件。操作系統:Windows,主機:本地主機使用postgresql-psycopg2運行「python manage.py syncdb」時,Django 1.5中的OperationalError
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'postgres',
'USER': 'JESS',
'PASSWORD': 'dreamhost',
'HOST': 'localhost',
'PORT': '5432',
}
}
我跟着安裝PostgreSQL和psycopg2
http://shivul.wordpress.com/2010/05/07/installing-django-with-postgresql-on-windows-and-ubuntu/
和運行python manage.py syncdb
我收到以下錯誤,當從這個博客的說明:
OperationalError: Could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432
Could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432
我甚至試圖通過PostgreSQL安裝文件中的pgadmin3應用程序編輯設置,它甚至會引發相同的錯誤r
Could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432
Could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432
我翻翻了類似的問題,在stackoverflow和互聯網,一切都過時或不工作。
在數據庫設置中,爲什麼您的端口設置爲「8000」?更改爲'5432' – karthikr
@karthik:Thankyou ..我仍然面臨另一個問題OperationalError:致命:密碼認證失敗,用戶「JESS」 –