Good morning, I am attempting to deploy a Django app on a DO Droplet and connect it to a DO managed postgresql instance and I am running into an interesting problem. I have set up numerous Django apps in the past but all on a private company network so the security was never an issue. This is my first attempt on DO with a public app. I run my connection string on the droplet server and appear to make a successful connection. I get a message regarding the protocol and cipher for the SSL connection and I get a PSQL prompt, as expected. I run a CREATE DATABASE statement successfully. When I list the databases, I see my newly created database. But, when I try to run a PSQL connection statement I get this error:
connection to server at “[database name from connection string].c.db.ondigitalocean.com” (10.x.x.x), port 25061 failed: FATAL: no such database: [newly created database]
connection to server at “[database name from connection string].c.db.ondigitalocean.com” (10.x.x.x), port 25061 failed: FATAL: SSL required
Details:
How can I use PSQL from my droplet to configure the DB and make sure the app runs when I install it? Thanks in advance!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
This comment has been deleted
Heya @benandreas,
Using Ubuntu 22.04 should be fine.
Can you please make sure you’ve done all the following steps/commands before trying the PSQL connection statement:
And see how it goes?
Remember to change
SomethingName
- with your actual DB nameSomethingUserName
with your actual User you want to useSomethingPassword
with the password you want to use.After that make sure to add the new information in your settings.py -
~/django-polls/mysite/settings.py
Additionally, what exactly is the statement? Can you share it so that I can try and recreate the issue on my end?