heroku: no default language could be detected for this app

Quick Solution

  1. Goto heroku dashboard (https://dashboard.heroku.com/)
  2. go inside app/project
  3. click setting
  4. scroll down little bit and click add build pack
  5. select your desired buildpack (in my case i have selected heroku/nodejs).

TLDR;

Actually what heroku does is, it tries to identify what project you are deploying by looking at files in your project, such as if your project have package.json file it understands it is a nodejs project, if your project have requirements.txt file it understands it is a python project and so on, see this document to see to know what languages you can run on a heroku server

as you know to run a specific project such as a nodejs project in a computer node runtime must be installed in that computer otherwise you can not nodejs app in the computer, what heroku does it runs each of your app in a different container, it means in one container it is only one app is running and of course that container have installed nodejs, so if a container runs only one app it doesnt make sense to install all other runtimes in the container so container have only one runtime in my case it is nodejs. they have ofcourse other type of containers such as one type for python and that container have installed python runtime(of a specific version) so if my app gets installed in python container it will not work because my app in in nodejs. for this very reason somehow we need to identify the type of app in beginning to choose correct container type, mostly heroku automatically detect it but if it is failed to detect you have to tell explicitly either by going to their dashboard settings or through runtime file in your project, and as you may have noticed you have do this only once.


For future references, you must ensure that you are pushing the branch with your code to heroku master.

If you branched from your master branch and all your code is on a, say, develop, push that to the heroku master.

So instead of:

git push heroku master

You would do something like:

git push heroku develop:master

This question has important details on this How to push different local Git branches to Heroku/master


You need to create a runtime.txt file. On the command line, in the same folder as your requirements.txt file, enter echo "python-3.5.1" > runtime.txt. Of course, make sure to switch the 3.5.1 with whichever version of Python you are using.


When deploying using Docker, ensure to set the stack of the app to container, as shown in the docs:

heroku stack:set container

I can't remember how I fixed this but looking at the Date Modified in my files after I posted this question I created two files:

runtime.txt (thanks rurp) which contains:

python-3.5.2

Procfile which contains:

web: gunicorn projectname.wsgi --log-file -

This is a Django project and projectname.wsgi leads to a wsgi.py located at

projectname/wsgi.py

This contains:

import os
import signal

import sys
import traceback

import time
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "projectname.settings")

application = get_wsgi_application()
application = DjangoWhiteNoise(application)