R
Railway13mo 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
Percy13mo ago
Project ID: N/A
TripleK
TripleK13mo 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
TripleK13mo ago
And the second way using railway shell give the first screenshot error Any help?
Solution
Brody
Brody13mo 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
TripleK13mo 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
Brody13mo 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
TripleK13mo ago
How do I go to the subdirectory before accessing railway link? I am using ubuntu cmd on windows
Brody
Brody13mo 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
TripleK13mo ago
Okey men you alright!! Its easy to install cli for windows. But now i have this error:
No description
Brody
Brody13mo 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
TripleK13mo ago
I'm quite lost hahaha How do I do what you say?
Brody
Brody13mo 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
TripleK13mo ago
Ok I'll give it a try
Brody
Brody13mo ago
does this django app use sqlite?
TripleK
TripleK13mo ago
No, only postgresql
Brody
Brody13mo ago
okay great
TripleK
TripleK13mo ago
Okey it solves thanks you very much Brody, you are a genius!
Brody
Brody13mo ago
haha thank you
Want results from more Discord servers?
Add your server