Reputation: 772
I have Django project deployed to Railway.app. I've installed Railway CLI, but can't understand how to run python manage.py makemigrations
and so on in its CLI to make Django runnig.
My laptop is running Windows 10 Home.
Ho do I?
UPDATE. Some results from the answers:
In settings.py use Railway's DB. In this case you don't need to run CLI commands via Railway CLI, you may use local and it will affect the Railway's DB.
railway login
railway link your_railway's_project_Id
railway status
to check whether you are in the right projectrailway run python manage.py createsuperuser
railway run python manage.py collectstatic
make migrations
migrate
still don't run on remote server.
In Procfile
I used code:
web: python manage.py migrate && gunicorn project_name.wsgi
Upvotes: 7
Views: 10943
Reputation: 5640
So, you should run IN YOUR PROJECT REPOSITORY :
railway link
-> Then select your projectrailway run <your command>
Upvotes: 3
Reputation: 39
you can do that by using railway run (command to be executed)
for example to create a superuser, use
railway run python manage.py createsuperuser
Check out this article
PS: Ensure you are in the same directory as that of the production because it will run both on local and production environment.
Upvotes: 3