Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syncing VirtualEnvs in multiple computer

I recently purchased a new laptop, so I'd be able to work not just from my workstation.

I have a Django REST app, and for this project I'm using a VirtualEnv.

My question is:
How can I "sync" the virtualenv to install the new dependencies packages?

In my workstation I installed Django, Django REST, etc...
What can I do so in my laptop I won't have to manually install the new dependencies every-time?

like image 911
Amir Tugi Avatar asked Dec 10 '15 19:12

Amir Tugi


1 Answers

Activate your virtual environment, then run:

pip freeze > requirements.txt

However you are transferring the code, you can transfer this file. Then on your laptop, can you make it part of your sync script:

pip install -r requirements.txt

Typically I have a pair of sh files that looks like

# upload change
pip freeze > requirements.txt
git add -a .
git commit -m "message"
git push

And

# Get files
git pull
pip install -r requirements.txt
like image 121
triunenature Avatar answered Oct 01 '22 19:10

triunenature