Is it bad to have my virtualenv directory inside my git repository?

前端 未结 9 2105
醉话见心
醉话见心 2020-12-04 04:42

I\'m thinking about putting the virtualenv for a Django web app I am making inside my git repository for the app. It seems like an easy way to keep deploy\'s simple and easy

9条回答
  •  遥遥无期
    2020-12-04 05:15

    If you know which operating systems your application will be running on, I would create one virtualenv for each system and include it in my repository. Then I would make my application detect which system it is running on and use the corresponding virtualenv.

    The system could e.g. be identified using the platform module.

    In fact, this is what I do with an in-house application I have written, and to which I can quickly add a new system's virtualenv in case it is needed. This way, I do not have to rely on that pip will be able to successfully download the software my application requires. I will also not have to worry about compilation of e.g. psycopg2 which I use.

    If you do not know which operating system your application may run on, you are probably better off using pip freeze as suggested in other answers here.

提交回复
热议问题