Deploying the application into railway.app is very easy process. As my previous article pointed out that you don’t need lot of changes in the code to make it work. Django deployment often result in many code changes but surprisingly deploying to railway.app is straightforward work.
Prepare the project
There is two changes you need to do in the codebase.
Create a .python-version and requirements.txt file
Create the Procfile
web: python manage.py migrate && python manage.py collectstatic --noinput && gunicorn gaclient.wsgi
Prepare the railway.app
Head to railway.app and create the account if you have not and then create the empty project.
- Create the database
- Create an empty service.
Note that when you create the database it automatically updated the environment variable in the project. Where DATABASE_URL is easily accessible and populated already in the environment variable.
After that head to variable section and add the project environment variable. Then connect to your GitHub in settings page.
Voila 🎉 your application is live and you can access the page. Connect the domain in settings if you use it with your own domain.