Issue
I am looking at debian and virtualenv and I was wondering what directory structure people would recommend. From my reading it seems something like this is a good idea:
Code:
var/www/<projectname>/src
Virtualenv:
var/www/<projectname>/venv
Can anyone do any better on that, or point me in the right direction please?
Solution
Your proposed directories would be fine if you intend to do a simple project. For larger or long term projects, you will likely want to use some sort of SCM tool such as git or mercurial. If you do want to use an SCM tool, it would probably be better to put the virtual envrionment in another directory so it will not be included in your SCM repository.
Putting the virtual envrionment inside your repository is generally unnecessary as answered here. Python has handy tools like pip to save the list of packages, and easily install them in another virtual envronment.
Output virtual environment packages with pip freeze
pip freeze > requirements.txt
Install packages from requirements.txt with pip install
pip install -r requirements.txt
Recommendation
Say you were using git for SCM, the code could be in
/home/jimmy/git/<projectname>
And the virtual envrionment could be located in
/home/jimmy/venv/<projectname>
Answered By - paladin235