15

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.

Platinum Azure
  • 45,269
  • 12
  • 110
  • 134
bsr
  • 57,282
  • 86
  • 216
  • 316

2 Answers2

30

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
jpic
  • 32,891
  • 5
  • 112
  • 113
0

Bad idea include .env on git, bcs not all apps installed in .env directory, part of this installed in your system directories

freylis
  • 814
  • 6
  • 15