Forums

Pythonanywhere postgreSQL connecting to local pgAdmin and django

I have had success connecting my local pgAdmin with the pythonanywhere postgres with the SSH tunnel of pgAdmin but I would like to use this database in my local django system as well

I am on Windows and I have been using Putty, I can successfully connect to the ssh.pythonanywhere port 22 but when trying to connect to the remote database I receive a "Forwarded connection refused by server: Connect failed [Connection refused]" in both my local pgAdmin and django's settings.py in the Putty event log.

Does that mean that I cannot enter the remote db? or I need to modify some .conf files in pythonanywhere?

For those interested, the solution is here: https://arduino103.blogspot.com/2015/07/introduction-hebergement-python.html

Good day PythonAnywhere,

I want to thank you for this beautiful service, it has made my journey to host my website vry smooth and void of issues. Thank you very much.

Please, I need a support in the area of Postgresql. I want to connect to my PythonAnywhere Database with my development tool, but I got this error "OperationalError: django.db.utils.OperationalError: connection to server at "mydatabase-3427.postgres.pythonanywhere-services.com" (10.0.0.174), port 13427 failed: Connection timed out (0x0000274C/10060) Is the server running on that host and accepting TCP/IP connections?"

My Development Environment is Visual Studio Code.

Below is my database connection details in my code **DATABASES = {

'default': {
    'ENGINE': 'django.db.backends.postgresql',
    'NAME': '******',
    'USER': '*******',
    'PASSWORD': '*******',
    'HOST': 'mydatabasename-3427.postgres.pythonanywhere-services.com',
    'PORT': '13427',
}

}**

I really need this to do some trouble shooting of my Application.

Thanks in anticipation to hear from you.

The hostname should be rather <your-username>-<number>.postgres.pythonanywhere-services.com. Have a look at those help pages for more information: