Django Heroku Deployment Steps

Posted 3 years, 10 months ago
Views 531
2 min read
0 reactions

Create the App in Heroku  using below URL,

Step 1:

heroku login

Step 2:

Navigate to the Django Project folder where resides

Step 3:

git init

Step 4:

heroku git:remote -a <app_name>

Step 5:

Create Procfile in PROJECT_HOME dir

Step 6:

pip install gunicorn

Step 7:

pip install django-heroku

Step 8:

import django_heroku

Add the following import statement to the top of

Step 9:

Then add the following to the bottom of


Step 10:

Django does not support serving static files in production. However, the fantastic WhiteNoise project can integrate into your Django application, and was designed with exactly this purpose in mind.

pip install whitenoise

Step 11:

Next, install WhiteNoise into your Django application. This is done in’s middleware section (at the top):

    # Simplified static file serving.

Step 12:

Finally, if you’d like gzip functionality enabled, also add the following setting to


Step 13:

If collectstatic failed during a build, a traceback was provided that will be helpful in diagnosing the problem. If you need additional information about the environment collectstatic was run in, use the DEBUG_COLLECTSTATIC configuration.

heroku config:set DEBUG_COLLECTSTATIC=1

Step 14:

Sometimes, you may not want Heroku to run collectstatic on your behalf. You can disable the collectstatic build step with the DISABLE_COLLECTSTATIC configuration:

heroku config:set DISABLE_COLLECTSTATIC=1

Step 15:

git add .

Step 16:

git commit -am "Initial commit"

Step 17:

git push heroku master

Happy Coding !!!

0 reactions


Posted 3 years, 10 months ago

if anyone stuck on deployment. You may raise the ticket in our developer portal Developer Portal. Team will guide you on this.


- tt0322816 Posted 3 years, 9 months ago


- bhanupriyakuchana123 Posted 3 years, 6 months ago

Posted 3 years, 6 months ago

the install explaination is good

Looking for Freelancing Jobs
Joined on April 15, 2020

Latest Videos