django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to...

5 months ago

Getting annoying error not letting me run railway run python [manage.py](manage.py) createsuperuser locally.

It's saying

django.db.utils.OperationalError: could not translate host name "postgres.railway.internal" to address: Name or service not known

Full trace attached.

Solved

0 Replies

5 months ago

44413aa3-4701-4299-bbbf-9317ef96b304


5 months ago

Railway run does not SSH into the host machine. It only copies the environment variables from the host machine to your local environment



5 months ago

Ok but how do I use the terminal on the server to run the commands I need to?



5 months ago

I understand that it does still with environment variables and whatever from my local machine, but I'd like / need to run the command as if I'm on the machine 😅 I'm just trying to create a superuser on my Django app. If there was a way to use terminal directly from the website I would use it. I don't know how else to connect to the database from my local machine.


5 months ago

@Brody has made some progress with SSH, but at the moment the official stance is that it's not possible.

The Railway Django Template may have some resources for you


5 months ago

Well, that helped me with a staticfiles issue, but I need help actually getting the command that seemed to work on previous projects but isn't working now to run django commands.

Please, specifically, I have an issue connecting with the database.

I can use whatever environment variable, as there are more environment variables than just database_url there, so what do I have to do to be able to run this command? I don't need "ssh" necessarily, I just need whatever commands I run on my local machine to allow my script to be able to connect with the database. Is it the Database public url?

Please, let me know SPECIFICALLY what to change and how to fix it. I gave you the project id. Can't you look?


5 months ago

I am not a member of the team, I cannot view your projects. This server is primarily community support. Support from the team is only available for Pro plan, or if the conductors deem a question fit for the team (billing, etc).

Your demanding attitude is not appreciated. I will leave you with the docs for the pre deploy step, after that you are on your own. https://docs.railway.com/guides/pre-deploy-command


5 months ago

as well as the docs for databases. https://docs.railway.com/guides/databases


5 months ago

Hi Adam! I thought you were part of the team lmao. My bad! I thought conductor meant you were a team member lol.


5 months ago

Thanks for the help then!


5 months ago

!s


Status changed to Solved adam 5 months ago