Recently I have decided to keep the pipfile and package.json related files outside the main project folder
The main project folder usually contains an app for the backend/api (Django) and another for the frontend (React)
This means the Procfile we create will be in a different folder than the manage.py file
New steps:
Create a new heroku app outside the project’s folder
Add the Python and Node.js buildpacks:
run heroku buildpacks:set heroku/python
run heroku buildpacks:add --index 1 heroku/nodejs
Create a new Procfile and paste web: gunicorn --pythonpath <project_name> <project_name>.wsgi --log-file - into it (this is now different because we have the manage.py file in a different location)
Create another file named Procfile_windows and paste web: py <project_name>/manage.py runserver 127.0.0.1:8000 into it and test it
Add to the package.json file:
Setup PostGres
Commit and push the changes and deploy by connecting GitHub to Heroku
(Some extra note: pipenv shell can create the Python environment from an existing pipfile, npm i creates the node_modules folder and its contents)