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!
CodePudding user response:
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.
CodePudding user response:
There is no problem to use git in virtual environments of python, git works exactly the same way; the only constraint, if you want call it in that way, is that the vir-env must be activated to make any operation (commit, push, fetch, etc.) with git.