首先,需要在您的项目根目录创建文件requirements.txt,其中包含您的Django应用程序所需的所有Python依赖项。检查您的应用程序是否包含名为runtime.txt的文件,其中包含您希望Heroku使用的Python版本。然后,使用以下命令将您的应用程序部署到Heroku:
$ cd myproject/
$ git init
$ heroku create
$ git add .
$ git commit -m "Initial commit"
$ git push heroku master
如果您的应用仍然无法与buildpack Django heroku兼容,可以尝试将应用程序的buildpack设置为python,并使用以下命令:
heroku buildpacks:set heroku/python
此外,您可以手动选择将使用的特定版本的buildpack,如:
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-python.git