Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django and virtualenv - Adding to git repo [duplicate]

For may first django app, I used the following process to create app.

$ virtualenv --no-site-packages django-env
$ source django-env/bin/activate
(django-env)$ pip install django
(django-env)$ django-admin.py startproject myproject

Now I have two folders

django-env
myproject

Do I need to include django-env in git repo (git init), or just myproject. When deploy, how the dependencies are handled.

like image 713
bsr Avatar asked Sep 11 '12 14:09

bsr


1 Answers

Don't add the env to the repo. Instead, before deploying, run command pip freeze and save the output in a text file say requirements.txt. This file should be in the repo. To install dependencies in a fresh virtualenv when deploying:

pip install -r requirements.txt
like image 157
jpic Avatar answered Nov 09 '22 18:11

jpic