Use pipenv with django heroku

Advertisements

So I began to code a project with python, and I was using a tutorial that told me to use a pip environment as my virtual environment. A problem arose, however, when I performed the git push heroku master command. It could not find the package django-heroku!

I was confused, because when I ran python manage.py runserver, the server on my computer ran. I then changed to a python environment, which was located in the directory I was pushing to heroku. The problem was solved! The virtual environment, and consequently the installed packages, were inside the directory being pushed to git, and I could use them in my website!

But the question still remains: can you use a pip environment for a django project being pushed to git? Thanks!

>Solution :

You should not include python packages within your repo and push them to Heroku. Check https://devcenter.heroku.com/articles/python-pip. You only need a requirements.txt file in your root directory. Heroku will install the packages automatically for you.

Leave a ReplyCancel reply