5π
A possible solution to this problem can be specifying the buildpack during app creation like :
$ heroku create myapp --buildpack heroku/python
or after app creation like:
$ heroku buildpacks:set heroku/python
Refer Docs : Heroku Docs
The other problem I figured was that I had unnecessary package.json
and other files in my django project. I solved it by removing unnecessary files from my app directory.
Since these files were obstructing the automatic detection of buildpack.
Another reason of failed detection could be wrong folder structure of your app. The Procfile
and other heroku files should be right at the start of the git directory otherwise your app wonβt get detected.
1π
- in your git bash :
echo "python-3.7.0" > runtime.txt
(adds runtime.txt file in your root directory with instructions to use python v3.7.0 by Heroku) git add .
git commit -am "another commit"
git push heroku master
0π
As for the documentation:
Heroku automatically identifies your app as a Python app if any of the following files are present in its root directory:
requirements.txt
setup.py
Pipfile
You can solve that with pip freeze > requirements.txt
, for example.
- How do I redefine functions in python?
- How to go from a Model base to derived class in Django?
- Django Rest Framework custom POST URL endpoints with defined parameter (request.POST) with Swagger or other doc