👉If you are using Django 5.0 the runtime.txt file (which discloses the python version) is actually required, as Railway's default Python version is still 3.8 🤨, but Django 5.0 only runs on 3.10 or higher!
I want to say a big thank you. Thanks to your videos, I got a job offer. Please keep making new course and django with new stacks. Your videos and content is very useful
Thanks for a much detailed guide on deploying django on Railway...I looked around for how to configure and deploy the database...all I got are quick default deployments~! Thanks again
It was driving me nut trying to get a simple test site up and running. The changes were not propagating to the site. Looked like the CSS wasn't being picked up. Thought it was something to do with Whitenoise or not getting the collect static done right. I spent a couple of days struggling. This morning I did some more tests and found my problem was the cache of the browser not letting the new stuff show. Locally everything was great. It is all quite complicated to deploy a Django project. I had a problem with the something not working because I am running the latest version of Django. Had to cut that out. Starting to think I'm winning and can get my proper project online after all the tests with the simple site. Things seem better on Railway than on Render for me. I like the interface and set up.
Yes, the browser cache for the CSS changes made me go mad also a couple of times. Now I always do a hard browser refresh to make sure i have the updated files. Indeed, deploying can be quite a pain because there are so many little things to consider. Regarding the latest Django version on Railway, you need to add the runtime.txt file with your python version. Railway's default Python version is 3.8, however the latest Django version needs at least 3.10.
i learned how to work with django template by watching your awesome project , allauth package integration also great, your django deployment playlist also very helpful thanks, please do celery and rabbitmq with django
Yea some of those concepts I will tackle in a future series, like building an API with the Django REST framework. Docker and Kubernetes are beneficial for sharing and scaling a project especially when working in teams and on larger complex projects, these topics I will probably cover a bit later down the line as they add complexity we don’t really need at the start.
Great video. One question - why not run the migrations as part of your deployment script? Connecting remotely and running db migrations manually isn't great for automating deployments, especially if more than 1 dev is working on the app.
yes absolutely, I am used to do it manually, but especially when you are not developing alone, running automatic migrations and other scripts is definitely the way to go.
Hi thanks for the video, I already deployed and can access my page from computers, tablets even my tv but not from iphone, it says 'Safari cannot find the page', do you know what could be the problem?
Hmm, my site works on safari. Safari has stricter security policies, so it might something related to CORS, DNS, SSL or some other configuration. You might also try to clear your browser cache or check if you are not using an old version.
Hi Andreas, the site I am building, users can add more than one photo handled by javascript. If I deplloy to AWS, would I still be able to follow your deployment series? further, I am really learning much from you. I actually finished your 2 series. I have added the profile edit and email notification htmx to my site.
No, for this you would need to install whitenoise. And if you have media files you need to connect to a media server. Check out my deployment series for more details.
Hello, I have deployed a django website to railway but I haven't been able to serve my media files. The static files are working fine but the media files aren't Please can you help
Hi, this could be because Railway doesn't allow to upload media files to their servers. You should use a 3rd party server to store media files such as cloudinary.
Hi, amazing tutorial! Thank you very much. I'm getting this error when trying to connect to the database. I would really appreciate it if you could explain why. raise e.OperationalError(str(last_exc)) django.db.utils.OperationalError: [Errno 11001] getaddrinfo failed
Hmm, this error could mean that Django can’t find the hostname of the database server. Is the database hostname correct? Could also be that the environment variables are not set properly. Can you connect locally to the database without problems?
👉If you are using Django 5.0 the runtime.txt file (which discloses the python version) is actually required, as Railway's default Python version is still 3.8 🤨, but Django 5.0 only runs on 3.10 or higher!
I want to say a big thank you. Thanks to your videos, I got a job offer. Please keep making new course and django with new stacks. Your videos and content is very useful
Oh wow that’s amazing! Congrats! All the best! ❤
Absolutely the best. All the others only do half the story and you do it all. Thank You
Exzellent stuff Bro, always a pleasure to watch you
Thanks for a much detailed guide on deploying django on Railway...I looked around for how to configure and deploy the database...all I got are quick default deployments~! Thanks again
Thank you for the feedback. I am glad it’s useful
It was driving me nut trying to get a simple test site up and running. The changes were not propagating to the site. Looked like the CSS wasn't being picked up. Thought it was something to do with Whitenoise or not getting the collect static done right. I spent a couple of days struggling. This morning I did some more tests and found my problem was the cache of the browser not letting the new stuff show.
Locally everything was great.
It is all quite complicated to deploy a Django project. I had a problem with the something not working because I am running the latest version of Django. Had to cut that out.
Starting to think I'm winning and can get my proper project online after all the tests with the simple site.
Things seem better on Railway than on Render for me. I like the interface and set up.
Yes, the browser cache for the CSS changes made me go mad also a couple of times. Now I always do a hard browser refresh to make sure i have the updated files.
Indeed, deploying can be quite a pain because there are so many little things to consider.
Regarding the latest Django version on Railway, you need to add the runtime.txt file with your python version. Railway's default Python version is 3.8, however the latest Django version needs at least 3.10.
Thanks for this man❤️
i learned how to work with django template by watching your awesome project , allauth package integration also great, your django deployment playlist also very helpful thanks, please do celery and rabbitmq with django
Yes, this is on the roadmap! thanks
This is good. When will you be doing a video that delves more into the backend stuff, like building APIs and the docker and kubernetes guys?😅
Yea some of those concepts I will tackle in a future series, like building an API with the Django REST framework. Docker and Kubernetes are beneficial for sharing and scaling a project especially when working in teams and on larger complex projects, these topics I will probably cover a bit later down the line as they add complexity we don’t really need at the start.
educative as always,thanks And
Nice content sir!
Great video. One question - why not run the migrations as part of your deployment script? Connecting remotely and running db migrations manually isn't great for automating deployments, especially if more than 1 dev is working on the app.
yes absolutely, I am used to do it manually, but especially when you are not developing alone, running automatic migrations and other scripts is definitely the way to go.
Hi thanks for the video, I already deployed and can access my page from computers, tablets even my tv but not from iphone, it says 'Safari cannot find the page', do you know what could be the problem?
Hmm, my site works on safari. Safari has stricter security policies, so it might something related to CORS, DNS, SSL or some other configuration. You might also try to clear your browser cache or check if you are not using an old version.
@@ajudmeisterTY, i alreday made it work when prushasing and using a custom domain rather than the one railway gave me
@@ajudmeister and by the ways your videos are really good already recommded your channel to friends and coworkers keep it up
supperbbbbbb many thx
Hi Andreas, the site I am building, users can add more than one photo handled by javascript. If I deplloy to AWS, would I still be able to follow your deployment series? further, I am really learning much from you. I actually finished your 2 series. I have added the profile edit and email notification htmx to my site.
Hi, that’s great to hear! Yes, AWS is pretty much the standard for hosting static files and I made a video how to set it up.
very good
Perhaps I missed something but how you managed static files, are they automatically managed by railway ?
No, for this you would need to install whitenoise. And if you have media files you need to connect to a media server. Check out my deployment series for more details.
@ajudmeister I will definitely check that out, thank you.
Hello, I have deployed a django website to railway but I haven't been able to serve my media files. The static files are working fine but the media files aren't
Please can you help
Hi, this could be because Railway doesn't allow to upload media files to their servers. You should use a 3rd party server to store media files such as cloudinary.
@@ajudmeister thanks for the reply, I later sorted it out and it's actually cloudinary that I used.
Everything is working perfectly now.
my django web app dont have any database , im using in built django admin only , will it be okay to do deployment? please tell
Sure you can deploy with the build-in SQLite database, however whenever you re-deploy the app you lose all the data you might have eg. your superuser.
how did u create this .env file?
Hi, have a look at the video where I explain them: ruclips.net/video/BO6O3I88mU4/видео.html
Hi, amazing tutorial! Thank you very much. I'm getting this error when trying to connect to the database. I would really appreciate it if you could explain why.
raise e.OperationalError(str(last_exc))
django.db.utils.OperationalError: [Errno 11001] getaddrinfo failed
Hmm, this error could mean that Django can’t find the hostname of the database server. Is the database hostname correct? Could also be that the environment variables are not set properly. Can you connect locally to the database without problems?