By Al3xs
I re-deployed my Django App on DO’s app platform but I am facing a new issue that I did not encounter before. Once successfully deployed, when I try to go into the console and run Django’s Migrate Command (python manage.py migrate) the following error is raised:
django.db.utils.OperationalError: could not translate host name “app-[…].db.ondigitalocean.com” to address: Temporary failure in name resolution
POSTGRES_DB: ${db.DATABASE}
POSTGRES_HOST: ${db.HOSTNAME}
POSTGRES_USER: ${db.USERNAME}
POSTGRES_PASSWORD: ${db.PASSWORD}
POSTGRES_PORT: ${db.PORT}
DATABASE_URL: ${db.DATABASE_URL}
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"HOST": os.getenv("POSTGRES_HOST"),
"NAME": os.getenv("POSTGRES_DB"),
"PASSWORD": os.getenv("POSTGRES_PASSWORD"),
"USER": os.getenv("POSTGRES_USER"),
"PORT": os.getenv("POSTGRES_PORT", 0),
}
}
The Database is called db (default).
I can connect to the database with the given connection details with my local PostgreSQL client.
I don’t know what else to try. 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!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.