R
Railway8mo ago
TripleK

CLI createsuperuser error

I have been in trouble with the cli command to create a superuser in python:
No description
Solution:
- railway run runs commands locally with the linked service variables available as environment variables. - railway shell opens a local sub-shell with the linked service variables available as environment variables. this means you want to be in your django project folder where manage.py exists, then link and then run the command...
Jump to solution
18 Replies
Percy
Percy8mo ago
Project ID: N/A
TripleK
TripleK8mo ago
First, i link the project and service. Then, i try 2 diferents ways to create superuser. The first one give me this error:
No description
TripleK
TripleK8mo ago
And the second way using railway shell give the first screenshot error Any help?
Solution
Brody
Brody8mo ago
- railway run runs commands locally with the linked service variables available as environment variables. - railway shell opens a local sub-shell with the linked service variables available as environment variables. this means you want to be in your django project folder where manage.py exists, then link and then run the command
TripleK
TripleK8mo ago
okey i understand! I did yesterday in my other threat help Remember? So when I select DRF FIBBEL i go to the django project folder
Brody
Brody8mo ago
yeah you would want to be in the sub directory for your django app, the folder with manage.py, then run railway link to link that folder with your django service in your railway project, then you can run the superuser command through railway run
TripleK
TripleK8mo ago
How do I go to the subdirectory before accessing railway link? I am using ubuntu cmd on windows
Brody
Brody8mo ago
haha don't make it hard on yourself, just open the folder in windows explorer right click and open in the native windows cmd, then run the commands easy enough to install the cli with npm for windows https://docs.railway.app/develop/cli
TripleK
TripleK8mo ago
Okey men you alright!! Its easy to install cli for windows. But now i have this error:
No description
Brody
Brody8mo ago
you are running these commands on your local computer, thus you would need to have all the modules and dependencies needed to run this project available on your local computer
TripleK
TripleK8mo ago
I'm quite lost hahaha How do I do what you say?
Brody
Brody8mo ago
you need to install the dependencies for your python project onto your computer I think that should be as simple as pip install -r requirements.txt (this done not need to be ran with railway run)
TripleK
TripleK8mo ago
Ok I'll give it a try
Brody
Brody8mo ago
does this django app use sqlite?
TripleK
TripleK8mo ago
No, only postgresql
Brody
Brody8mo ago
okay great
TripleK
TripleK8mo ago
Okey it solves thanks you very much Brody, you are a genius!
Brody
Brody8mo ago
haha thank you