7 months ago
Greetings. I wanted to do a quick write up on this so I wanted to confirm some information. I am unable to create a super user in my Railway hosted Django project using the Railway CLI, despite previously being able to do so. I am not getting an error, I am just creating my super user locally. According to this post https://discord.com/channels/713503345364697088/1344083692544589895/1344083692544589895
"It only copies the environment variables from the host machine to your local environment"
Project ID 89d9c852-c3c1-4317-9fa4-f98dbef6772f
In the CLI API Reference docs it says "The Railway Command Line Interface (CLI) lets you interact with your Railway project from the command line." I feel like this is not explicitly saying "It only copies the environment variables from the host machine to your local environment." Did I miss something elsewhere on the page CLI API Reference page that would clarify this?
Sorry to waste time with this but I wanted to clarify before doing a write up.
I would have tagged this docs but the tag was not available.
0 Replies
7 months ago
you are looking for railway ssh --
I did see that ssh was operational now. 🎉
I did try to run the commands I needed to run once I SSHed into my project but I was unable to find my application either manually or using find.
7 months ago
you would want to use railway link
7 months ago
your app code should be at /app
7 months ago
forgive me for not noticing, but you are linked to Postgres, not your application
Thank you. I didn't realize that when railway link asks for a service, I should select my application.
7 months ago
let me know if all works as intended now
So I am getting a ModuleNotFoundError: No module named 'dotenv'
error when I tried to run python [manage.py](manage.py) createsuperuser
and ./[manage.py](manage.py) createsuperuser
.
Which I initially thought was correct but I have added & pushed changes to my requirements file. The logs say that dotenv has been installed. I went ahead and installed dotenv through ssh (and python too, which makes me think I am not in the correct environment?) and I am still getting the same error. I know that this isn't the original issue but it is keeping me from verifying that the method you suggested works.
6 months ago
are you linked to the correct service in the correct environment?
6 months ago
then please link to the correct service
Just to clarify that this is the correct environment I access on the railway dashboard.
But I don't have any of the packages that I utilize in my deployed project and the only packages that are there are the ones I installed by hand through Railway's SSH.
6 months ago
you likely need to activate the venv with . /opt/venv/bin/activate
6 months ago
no problem!
6 months ago
!s
Status changed to Solved brody • 7 months ago