Why is my Flask app being detected as node.js on Heroku

前端 未结 2 1112
情歌与酒
情歌与酒 2021-01-04 06:47

I recently made some changes to the structure of my Flask app hosted on heroku and now heroku has decided to detect it as a Node.js app intead of a Python app. My applicatio

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-04 07:31

    The package.json file is causing Heroku to detect it as a node.js app. To prevent this, add the file name to a .slugignore file:

    echo 'package.json' >> .slugignore
    git add .slugignore
    

    .slugignore is like .gitignore. It resides in the root directory of your repository and should contain a list of filenames and wildcard patterns. The matching files remain in your git repository, but are deleted from the slug after you push to Heroku. The deletion occurs before the buildpacks run, so the node.js buildpack won't find package.json and the app won't be misidentified as a node.js app.

提交回复
热议问题