damn it bro, the only video in all youtube that managed to explain to the letter the deployment of the app in railway without problems. thank you very much bro
hi, thank you for all your videos, they are so helpful. wanted to ask how would you deploy a fullstack application with both django and react? would you deploy them both on the same platform? what platform would you use? thank you sir
It depend on the platform you want to use, if you want to use AWS then yes, you can deploy the both on the same platform. Deploy Django on EC2 and react AWS Amplify
@@desphixsare there any free options like railway? if im not wrong AWS will require some cost? could you make a video on this one day sir, would be much appreciated
Thank you for the turial. I followed you deligently but mine didn't work. In my deploy log, it show: Operations to perform: Apply all migrations: accounts, admin, auth, contenttypes, sessions Running migrations: No migrations to apply. /bin/bash: line 1: gunicorn: command not found please, this is my first time deploying a webapp, I will appreciate helping me out.
Let start by checking if you have gunicorn in your requirements.txt file. Do you?? Another thing that might cause that migration error, is deleting your migration folder or Messing with it before deploying? If that's the case clone your project onto your local PC and try running it after making migration and migrate. One more question. Did you site get deployed, like: can you visit your site now using a domain name?? Before seeing the migration error??
Does the web app still maintain the crud functionality if u deploy like this? Or do u have to set up a new database on railway? Awesome video. I learned a lot.
Yes, it will still maintain the CRUD functionality after deployment, but to preserve your database permanently, you will need to provision a live database
Hey man. Thanks for this awesome tutorial! But my static files are not loading in the railway app. Can kindly show me how your {% url 'link' %} i set in templates?
My appologies for late reply, if you have not fixed this yet then let's debug it together. 1. For the url link you are talking about, {% url 'name_of_url' %} NOTE: name of url is the path(..., name="name_of_url") 2. Have you run the command *python **manage.py** collectstatic* 3. Are your static root and static url configured in settings.py and project's urls.py Let me know if there is another issue okay?
You need to host your static and media files somewhere else, that's a must or else whenever you re-deploy your site, all your media files (dynamic images and files) would get deleted again.
it didn't work. In anyway, I need more than 500 hrs for free. The error is with Postgresql I think, "connection to server at "127.0.0.1", port 5432 failed: Connection refused". Thanks.
No they don't, it's remain active. But when your 500 free hour runs out, your site get disabled, you won't be able to access it again, till the next month when the 500hr get refilled again. But you can remove that limitations by verifying you account using your credit card, just make sure that: if the app you're hosting isn't that important or it's just for testing then make sure to disable it yourself or you'd run out of 500 hrs Dyno to host other apps or view hosted app till the next month.
Hello, I'm from Brazil. Thanks for the video. In deploy I have the following error message: do you know what it could be? usage: gunicorn [OPTIONS] [APP_MODULE] gunicorn: error: argument --error-logfile/--log-file: expected one argument
Hello again! I'm having another issue with Railway. When I installed a cloudfare proxy for railway, I keep getting the error: ""SSL handshake failed Error code 525". I tried all the solutions I could find but to no avail. Any help would be appreciated.
Error code 525 in Cloudflare typically indicates that the SSL handshake between the Cloudflare proxy server and your origin server failed. This error occurs when the SSL certificate on your origin server is either missing, expired, or not configured correctly. Here are a few steps you can take to troubleshoot and resolve the issue: 1. Verify SSL certificate: Double-check that the SSL certificate on your origin server is valid and properly configured. Ensure that the certificate is not expired and matches the domain you are using. 2. Install a valid SSL certificate: If you don't have an SSL certificate installed on your origin server, you'll need to obtain one. You can either purchase an SSL certificate from a trusted certificate authority or use a free SSL certificate provider like Let's Encrypt. 3. Check SSL certificate configuration: Make sure that the SSL certificate is correctly installed and configured on your origin server. Ensure that the private key, intermediate certificates (if any), and the SSL certificate are properly set up. 4. Verify port settings: Ensure that your origin server is correctly configured to listen on the appropriate SSL/TLS port (usually port 443). 5. Firewall and security settings: Check your firewall or security settings to ensure they are not blocking the SSL handshake. Cloudflare connects to your origin server using specific IP ranges, so make sure those are not blocked by any firewall rules. 6. Cloudflare SSL/TLS settings: Double-check your SSL/TLS settings in the Cloudflare dashboard. Make sure you have selected the appropriate SSL mode (Flexible, Full, Full (Strict)) based on your origin server's SSL configuration. 7. Clear browser cache: Sometimes, the error may be caused by a caching issue. Clear your browser cache and try accessing the website again. 8. Contact Cloudflare support: If you've tried the above steps and the issue persists, reach out to Cloudflare support for further assistance. They can help diagnose the problem and provide specific guidance based on your setup. Remember to always backup any configuration files before making changes to your server or Cloudflare settings.
Thanks a lot. very helpful. How to take care of environment variables (.env file).. does it require any setting in railways. assuming I will push it to github with env file.
Railway have this add variable feature, all you need to do is add your variable there e.g there would be two boxes add SECRET_KEY in the first box, then the one beside it add your secret_key_value as easy as that, you can add multiple
Heyy This was a good tutorial keep it up But how can i connect to a database like mysql, am trying but i get (2002, "Can't connect to local server through socket '/run/mysqld/mysqld.sock'(2)")
If you have stored your API key as an environment variable in a repository on GitHub, it is important to note that environment variables stored in a GitHub repository are not secure. When you push changes to a public GitHub repository, including environment variables, they can be accessed by anyone who has access to the repository or by automated tools that scan for exposed credentials. When you host your application on Railway, the environment variables set in your GitHub repository will not be automatically accessible to your Railway-hosted application. Railway has its own system for managing environment variables, which is separate from the GitHub repository. To securely manage your API key on Railway, you should use the environment variable management feature provided by Railway. This allows you to set environment variables specific to your Railway project and ensures that they are securely stored and accessible only within your Railway deployment. Here's how you can manage environment variables on Railway: Go to your Railway project dashboard. Select your project. Navigate to the "Settings" tab. Look for the "Environment Variables" section. Add your API key as a new environment variable. By managing your environment variables directly within Railway, you can ensure that your API key remains secure and is not exposed in your GitHub repository, I hope this helps.
@@desphixs i can’t seem to be able to successfully open a railway account, i keep being told that I don’t have enough information of me on GitHub and they are trying to make me subscribe to the team package instead
Have you fixed this yet?? A couple of thing might be wrong and if I can't see your code I can't really debug, seems the error is even from railway and not your code. Is it working yet?
Hola, esto lo puedo con pycharm ahi tengo mi proyecto pero cuando quise hacerlo con heroku ya no era gratis y estoy buscando alternativas. Igual es mi primera vez haciendolo. Me ayudarias. Muchas gracias
Hola amigo, mis más sinceras disculpas por la respuesta tardía. Sí, por supuesto, hay alternativas a heroku, puede utilizar el ferrocarril, su plataforma de alojamiento es mucho más fácil de usar que heroku. railway.app
Could someone help me clarify a question? I've successfully deployed my Django App on Railway using SQLite. Now, let's say a user makes a post request that updates the database. Will these changes be reflected in my GitHub repository? In other words, if I make a new push to my GitHub repo and Railway re-deploys, will it recognize that the existing database file is already up to date and avoid replacing it with the outdated one from GitHub?
Hi there, I'll be helping answer your question today. When you deploy your website to a live server in our case railway, and a user makes a post on the live website, the post data that the user just created does not get saved in your repository and that is because GitHub is not a database system, when you deploy to railway, a "unique & free" database is assigned to your website and all new posts or comments will be saved on that database, now let's say on your live server you have gotten 35 new posts but on your local development server you have only two posts, if you make some changes to your code, push to GitHub, then deploy to railway, remember that "unique & free" database that was assigned to you? It gets deleted and a new database is assigned to the new deployment you just did. To prevent this and always preserve your new data (posts, comment e.t.c) then you need to provision a live database e.g postgresql, connect it to your project and re-deploy. Now you'd notice that, when there is a new post or comment from users, and you make changes to your website and re-deploy, those data does not get deleted again. That's because the new database that you created is no longer for testing purposes, rather for a real website. GitHub is only used for keeping track of your code, it's like a house holding your code and serving it to railway, then railway is reading the codes there and displaying the appropriate pages and functions e.t.c There is still a lot more on this topic and I'll look into make a full comprehensive tutorial explaining the process of deployment in-depthly
@@desphixs I see, Thank you very much! Can I somehow download that unique & free database that was assigned to me so that I can manually push it to github?
@@huzaifafaheem6382 yes you can, but you cannot just directly download the whole db, there is a way to do it, buts it's tricky. The best way I'd recommend is to use django_import_export package, export all the model objects (posts or comments) from the live server, import it in the local server then re-deploy again, now those files would stay there permanently.
Hi bro .. Bro please help me if u can , i got error when i wanna deploy my project in railway .. it says 'Docker build failed ' .. what should i do to fix it ? I really need it😢
send me your project link if possible, i cannot really tell what is going on. You can also check the error and build log, copy it, paste it in pastebin.com/ and send me the error and build log, so i can debug the issue.
@@desphixs bro it's ur instagram clone project .. But I made small changes in it.. for example, I changed the registration page and the login page, and made some changes in the frontend.. How can I give you the link? Can I give the link to the project in GitHub? Sorry about my english bro btw😅
@@valentinfigueiredo but the website is opening up in the browser right, it's just that it's laggy?? Did you delete your media files before hosting?? To show your static files you need to run the collectstatic command and it's highly recommended that you use an external platform like aws s3 or azure to host your static and media files. Tell me if there is still any problem??
Thanks. The database would read and write operation as it usually happens in the development environment, but the database would get deleted after a day I think, or after your free 500hr runs out, provisioning a postgresl and connecting it is easy, I can make a tutorial if you'd watch it.
Can I deploy in Railway if I have an Integrated Payment Gateway? Please help me clear my doubt . BTW, Im a big fan of your work. Following for a while. ❤❤
Thanks buddy! To better understand your question, do you mean, can deploy your web app using railway, if you an integrated payment gateway? Please what’s an integrated payment gateway? Is it like a payment method?
@@desphixs Sorry, If i sound wrong, actually Im a beginner and trying to understand the process. My query is suppose I have integrated Stripe as payment method then can I deploy it in 'railway ' ? If it is , then will there be any need of customization to do that?
@supreme4256 Yes, if you have it integrated stripe as a payment method you can deploy your railway. Here is a breakdown of the process 1. Create a stripe account 2. Verify your stripe account by linked a credit or debit card 3. Choose a plan, maybe the 5$ plan 4. Then follow the steps in the video to deploy your app
@@desphixs Once again I must admit that I have never seen a Mentor/RU-vidr as dedicated as you in terms of supporting followers. God bless you and may keep you in good health to deliver us more knowledge. Thank you.
Hey there, Desphix! Awesome video! Unfortunately I'm having this error: "Application Error | Is your app correctly listening on $PORT? " Can you help me?
@@desphixs The build logs is too large, so i pasted it on Google Docs docs.google.com/document/d/1qSoYA1T8sdU9mPqCo0P57iWqU6LwQ1SJKZfin0Ts_yE/edit?usp=sharing
So after adding the csrf_token did the error persist?? If yes checkout this thread. It should give you some clue forum.djangoproject.com/t/deploy-a-django-project-on-railway-how-to-fix-the-csrf-verification-failed/16832
Then there is an issue with the deploy, you need to check your deployment logs, you can copy and paste it here if you need assistance detecting the error
@@MaxWalker676 same here, when i try to log into admin panel I have this error " Forbidden (403) CSRF verification failed. Request aborted.", tied to add CSRF_TRUSTED_ORIGINS, but it didn't fix the problem, maybe someone know how to fix this issue?
Hi great video: but i have a problem: My django version is 3.11.0b5. When im trying to create a user in the django app (register user) in Railway i have an error: Origin checking failed does not match any trusted origins.
I am meeting an issue with static files. After collecting staticfiles and pushing the project to GitHub, Railway can't find the static files, even if they have been pushed on GitHub. Can anyone help me? In local, everything is working ok.
You need download railway CLI. Login in this CLI and just run 'railway run ' for create super user you need 'railway run python manage.py createsuperuser'. You can see every command in docs for railway CLI
@@desphixs Hi, please I installed the railway CLI but when I link my project and run "railway run python manage.py createsuperuser", it returns an error saying "python: can't open file: [Errno 2] No such file or directory exit status 2". Any help would be appreciated.
My apologies for late reply. If you're still having the error, the checkout this thread, it should give you some clue forum.djangoproject.com/t/deploy-a-django-project-on-railway-how-to-fix-the-csrf-verification-failed/16832
@@desphixs railway paused deployments, I wasn’t even able to connect my repo. After that was over I still wasn’t able to deploy due to my account not meeting their “criteria”.