Connection refused using pythonanywhere
Hello, I'm trying to host my python Flask application using pythonanywhere, but I'm running into an issue using Neon postgresql database.
For some reason all works good while running the application on localhost, but once I try to start the app on pythonanywhere and try to read or create an entry from the database I get this error with Connection refused and don't really know why?
6 Replies
wise-whiteOP•12mo ago
error log
Shortened as I can't post the full error message
Code
rival-black•12mo ago
After a quick search, I came across this page
If you want to use a Postgres server run by some other service Just upgrade to any paid PythonAnywhere plan -- the cheapest one will work just fine. You don't need to check the "Postgres" option -- that is for creating a PythonAnywhere-hosted Postgres server, which of course you don't need. Paid PythonAnywhere accounts have unrestricted Internet access so once the upgrade has gone through, you will be able to connect to your remote Postgres instance.Are you connecting from a paid account? https://help.pythonanywhere.com/pages/Postgres/
PythonAnywhere help
Can I use Postgres on PythonAnywhere?
Yes! But you need a paying account.
If you want to use a Postgres server run by us:
If you have a free account, go to the Account page, and click on one of the
buttons for upgrading to a paid acc
wise-whiteOP•12mo ago
Ah I see, I though that only applies only to their version of hosted Postgres...
yappiest-sapphire•11mo ago
I have a similar issue and a paid PythonAnywhere (PA) account (not including their PostgreSQL option). The error message I get boils down to this: , even when . My working hypothesis is that the Postgresql library available on PA is too outdated to support the Neon services' security requirements. According to , the version available is 12.11 ... which is beyond EOL. BTW: This is how my connection string is generated: Note the endpoint-option, which is described here: https://neon.tech/docs/connect/connection-errors#the-endpoint-id-is-not-specified
Neon
Connection errors - Neon Docs
This topic describes how to resolve connection errors you may encounter when using Neon. The errors covered include The endpoint ID is not specified Password authentication failed for user Couldn't co...
rival-black•11mo ago
Hmm, I'd get in touch with the PythonAnywhere team
yappiest-sapphire•11mo ago
Yeah, I emailed them. Here is an excerpt of my question:
«(…) The server I am connecting to is running version 16, but from what I can find, PythonAnywhere is running version 12.11 - which is EOL according to postgresql.org and as far as I can tell does not support the security requirements for connecting to the server I am using. When will you upgrade and to what version?»
And their response:
«Hi there,
I'm afraid it's not available yet. I can't say exactly when it will be.
All the best, [REDACTED]»