Answer the question
In order to leave comments, you need to log in
Should I add virtualenv to git?
Actually, for a faster and more convenient deployment, I decided to collect the entire environment in a virtualenv, is it worth throwing it into the git repository and is it generally legal? And if not, what are the best ways to use to synchronize the working environment with several working computers + server.
Answer the question
In order to leave comments, you need to log in
It is better to write dependencies in requirements.txt and add this file to git.
An example of a file (you can specify versions through ==, you can without):
Django==1.8.5
django-flat-theme==1.1.1
mysql-python==1.2.5
gunicorn==19.4.1
pytz==2015.6
python-memcached==1.57
django-debug-toolbar==1.4
It often happens that some of the packages are needed during development and are not needed in production. And vice versa. Therefore, it would be desirable to separate the requirements for development and for production.
Requirements files can be included in one another. In this way, dependencies can usually be split into 3 separate files.
For example:
reqs/
- common.txt
- prod.txt
- dev.txt
common.txt will contain all required common dependencies. Ceiling example:
Django==1.8.5
mysql-python==1.2.5
-r common.txt
ipyhton
ipdb
django-debug-toolbar==1.4
-r common.txt
gunicorn==19.4.1
whateverelse=1.0.0
pip install -r reqs/prod.txt
В директории с ГИТ-ом пропиши:
И в этой же директории будет создан файл с нужными пакетами. А потом как написал Андрей Шубин
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question