CLI createsuperuser error
I have been in trouble with the cli command to create a superuser in python:
Solution:Jump to 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...18 Replies
Project ID:
N/A
First, i link the project and service. Then, i try 2 diferents ways to create superuser. The first one give me this error:
And the second way using railway shell give the first screenshot error
Any help?
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 commandokey i understand!
I did yesterday in my other threat help
Remember? So when I select DRF FIBBEL i go to the django project folder
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
How do I go to the subdirectory before accessing railway link? I am using ubuntu cmd on windows
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
Okey men you alright!! Its easy to install cli for windows. But now i have this error:
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
I'm quite lost hahaha
How do I do what you say?
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
)Ok I'll give it a try
does this django app use sqlite?
No, only postgresql
okay great
Okey it solves thanks you very much Brody, you are a genius!
haha thank you