heroku: no default language could be detected for this app

后端 未结 11 800
予麋鹿
予麋鹿 2020-12-03 22:40

First time using Heroku. Trying to push. I have run the command:

heroku create --buildpack heroku/python

and it displayed

$ hero         


        
11条回答
  •  青春惊慌失措
    2020-12-03 23:18

    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)
    

提交回复
热议问题