Error during deploying django app in Heroku

Viewed 334

I am trying to deploy a Django application to Heroku. When I followed the documentation and tried the command git push heroku master, I am getting an error: failed to push some refs to 'https://git.heroku.com/sleepy-eyrie-25993.git'. I searched online and tried to use git pull. But it didn't work. I also tried using git push -f heroku master, but still getting the same error. Is there any other way to do it? I followed this doc https://devcenter.heroku.com/articles/python-support. Tried using the heroku dashboard, but it is giving the same error Building on the Heroku-18 stack ! No default language could be detected for this app. HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically. See https://devcenter.heroku.com/articles/buildpacks ! Push failed

2 Answers

You can also deploy from your application dashboard on Heroku

Heroku deployment requires requirements.txt in the root of the repository. Also, to run a Django app - it requires file Procfile

Sample content:

web: gunicorn your_app_name.wsgi:application --log-file -

You can also try to specify buildpack manually by executing:

heroku buildpacks:set heroku/python

Then if there are additional errors starting - they will be more specific

Also settings.py of your Django application should contain the following:

import django_heroku

django_heroku.settings(locals())

For more details, please refer Here

Related