Introduction
We have already seen the process of deployment of a Django app on Heroku, now we can move to another platform which is Rail...
For further actions, you may consider blocking this person and/or reporting abuse
Beautiful piece, thank you so much but I'm getting this error message "Application Error
is your app correctly listening on $PORT?"
I have done every thing I can from creating an environment variables in my railway project to deleting my project severally but still after a successful deployment my project still crashes.
Have you entered the port number correctly from the postgres service on railway. I think that is probably the issue.
Alright I'll try that out, although I didn't use postgresql for this project I used Django's default sql lite, I'll try this out and get back to you. thank you so much
Fixed the issue. thanks for your assist
Hey, May I know how you have fixed the issue?
@osahenru May I know how you fixed the issue?
Add logging to your app then git and deploy. On your dashboard under deployment there is a view logs button.Then click build logs .This will tell you the exact problem.
Thank you I'll try this out too
halo, i followed this and i'm getting this error when i apply migration
Thank you for reading and giving feedback,
Make sure you have created the PostgreSQL database service on Railway, specified the
DATABASE_URL
properly in the.env
file, and setupdj-database-url
for smooth working of the database operations.Also you could try an alternative way instead of installing and setting up the dj-database-url:
Let's say my database url is given by railway as:
This is of the format,
So, we can convert this URL into a object like representation of the remote database in django settings.
Try these few things out and let me if it still doesn't works.
tnks this worked but now i'm getting a different err
The address of the hostname must be taken from the URL and don't use
Localhost
.very thorough post! I need to give railway a try
Just curious. What kind of app will you deploy?
No idea, I don't have anything that I need public compute for at the moment.
please help me out with this error
There might be problems in the psycopg2 package installation, so I have already mentioned in the post:
If psycopg2 doesn't work, remove the packge from the requirements.txt file and add the psycopg2-binary package after installing.
Hi Raj.. Please my own case is a bit different. I created different environments for the development and production. In development, I'm using sqlite3 database. In production, I'm using postgresql though through dj_database_url. Please, how do I createsuper user in production environment?
After a successful deployment of a Django app to railways how do I add a superuser admin?
Make sure your app is running on railway, and you can also add the railway database locally and run
python manage.py createsuperuser
. From this you can connect the railway db locally and create a superuser. From there on you can use admin from the deployed app.You should add how to deal with media files in production. This will make this blog complete
This helped me today, thanks for the updates.
Hello, this is a beautiful write-up, i followed it and i have my app deployed, but i have one request, on heroku, we have an app called heroku scheduler, whats the alternative on railway?
Railways have developed complete guidelines. Thank you.
I have this error while deploying on Railway, what should I do
Hello! How should I configure Django to serve media files?
I haven't tried media files, though you can look into this post, it might be similar to it.
Please I'm getting this error, any idea how to fix it.