1

Trying to connect to a remote server, serving my posgresql

My settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'mydatabase',
        'USER': 'mydatabaseuser',
        'PASSWORD': 'mypassword',
        'HOST': '[email protected]',
        'PORT': '5432',
    }
}

Getting error:

django.db.utils.OperationalError: could not translate host name "[email protected]" to address: Name or service not known

Where the hostname and host is of course not hostname and host, just using for this example.

1 Answer 1

1

For the host, you have to pass the ip address or the domain name of your postgresql host instance.

'HOST': 'host.com'

or

'HOST': '<ip_address>'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.