Deploying a Django App to Heroku Using Github Repository
Last Updated : 23 Jul, 2025
Heroku is a free hosting cloud service provider. We can use our free dynos to deploy our applications on the cloud. The only disadvantage is that it loses all the data once the app sleeps and it cannot handle multiple requests at a time when hosted on free dynos.
First of all, to proceed further you need to have these two things ready
Django app
Heroku account
We need to do certain amendments to the Django app to get it ready to be hosted.
Preparing Django app :
Install gunicorn library using the below command
pip install gunicorn
Create a file without any extension and name it as Procfile
You can enable automatic deployments to maintain the latest changes with your commits or else you can deploy whenever you want with the latest changes.
Now your app will be available at https://yourappname.herokuapp.com/
If you have selected automatic deployments all your commits get deployed otherwise you need to deploy your changes.
The best part is that if any deployment does not work you can roll back to any version you want by simply clicking the rollback option in the "Activity" tab.