Make sure that if you are deploying to Digital Ocean that you have whitelisted the IP (unless it’s running on the same server) for your server.
So try something like pg-admin great tool. To test a connection with your username and password to the database. Most likely it’s a username password issue when trying to connect to the database.