Best practices of using virtual environment for web development with Django?
django, vagrant, virtualenv, web-applications
Solution
Virtualenv sets up a local sandbox for you to install Python modules into.
Vagrant is an automation tool for creating Virtual Machines.
VirtualBox is a free, open source environment for running virtual machines, like those created by Vagrant.
Virtualenv is really about all you'll need to do sandboxed development on your local machine. We use Vagrant at my work to automate the creation of VMs. This way new developers coming on to a project have basically zero configuration to do in order to start working.
If you're collaborating with other devs, they don't need to do any of the above to work on your Django project, but if there's a lot of configuration involved that can't be done with pip and a requirements.txt, then you might look at Vagrant to ease some of that automation.
But you are correct in your assumption that you can all just work on a local branch and push back to the repo. Everything else is just icing.
Problem
This is a Django and Python and maybe just a general web development question. what's the difference between using virtualenv vs vagrant vs virtual box and etc... ? I'm kinda confused as to when to use which one :/ I've been using virtual env this whole time and creating new virtual environments for different projects.... Is this the right way to do it? One virtualenv per project? I'm not really sure when and where vagrant comes into play...Am I supposed to set up vagrant and then use virtualenv? This is probably a silly question but...if I were to be working on this project with other people. Would they too have to set up a virtual env? Just to collaborate? Wouldn't it make more sense that we all work on our local machines and then push it into the main branch? I'm just kinda confused .... I feel like I'm doing it all wrong... Thanks for the replies everybody!