0
내가 로컬이 같은 Heroku가 postgre의 SQL 데이터베이스에 연결을 시도하고, 로컬
from flask import Flask
import sys
import psycopg2
import urlparse
urlparse.uses_netloc.append("postgres")
url = urlparse.urlparse("postgres://url")
conn = psycopg2.connect(
database=url.path[1:],
user=url.username,
password=url.password,
host=url.hostname,
port=url.port
)
그러나
나는 다음과 같은 오류가 긴 일시 정지 후psycopg2.OperationalError: could not connect to server: Connection timed out
Is the server running on host "URL" (IP) and accepting
TCP/IP connections on port 5432?
이 오류를 수정하고 데이터베이스에 로컬로 연결할 수 있습니까?