[Python] django.db.utils.OperationalError: could not translate host name...

Discussão em 'Python' iniciado por Stack, Março 20, 2025.

  1. Stack

    Stack Membro Participativo

    django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to address: nodename nor servname provided, or not known


    My Django project was working great until I changed the setting.py file to deploy it in Railway, using the variables Railway provides.

    Since then, I can't runserv or migrate, that I get this error...

    Here are the database settings changed to use the Railway variables:

    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.postgresql',
    'NAME': 'railway',
    'USER': 'postgres',
    'PASSWORD': DB_PASSWORD_RAIL,
    'HOST': 'postgres.railway.internal',
    'PORT': '5432',
    }
    }



    Error when I runserver or migrate:

    django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to address: nodename nor servname provided, or not known

    Continue reading...

Compartilhe esta Página