Vagrant and virtualenv

Alright 3 questions here:

Whats the postinstall.sh that is found on every vagrant VM for? do i need to run it everytime I create a new VM?

Second, whats the purpose of using vagrant together with virtualenv? isn't the whole point of using vagrant is to create a self-contained VM?

Third, from what I understand so far, Vagrant has some functions to help setup the VM with the required software packages, so why not install pip, django, and so on through its provisioning system?

Also, thanks a bunch for doing this :), glad my first kickstarter contribution turns out so awesome!

Sorry You must be a logged in, registered user to answer a question.

Answers

Yes, Vagrant creates a self-contained environment, but the point of using Vagrant is to more closely replicate Heroku, since that is our production environment, and Heroku uses virtualenvs. I also think it's a damn good idea, 99.9999% of the time, to use virtualenv anyway. It's a good practice to get into and I'd rather encourage it than point out ways around it.

Could it be that the author wanted to emphasize the need to be familiar with the most python specific stuff, like pip, virtualenv and django installation? These python tools will always be good to master, even if you would not bother with vagrant and VM setups.

postinstall.sh installs the necessary packages (cookbooks) like Git and PostgreSQL (found in the Cheffile). run it only once, after you boot the VM for the first time.

you might need to install different Django version or another framework with libraries that might not work with others or cause some problems, so it is better to isolate each version or framework in its own virtualenv environment .

vagrant has a lot of benefits. specifically when working in teams, you can ensure identical development environments for everyone on your team.

http://net.tutsplus.com/tutorials/php/vagrant-what-why-and-how/

http://docs-v1.vagrantup.com/v1/docs/getting-started/why.html

We need to create the project directory manually and have the virtualenv activated in it before installing Django and other packages. Every user may choose different location or name for the project or different package version so we can't automate this task for everyone.
mutassem on
Could it be that the author wanted to emphasize the need to be familiar with the most python specific stuff, like pip, virtualenv and django installation? These python tools will always be good to master, even you would not bother with vagrant and VM setups.
eduardovs on
You install only one VM box (which acts like somehow a dedicated OS inside yours ) and inside it you can have multiple projects, not a VM per a project, so we use virtualenv.
mutassem on
also, for my last question, what I asked is that because in the guide video, one of the step is to log into the vm, and install some python packages such as pip, virtualenv, and django manually. why not automate it?
hdra on
About the 2nd and 3rd question, there are still some things that I don't understand. Isn't the most common use case for vagrant is to set up a VM for each project? So, why would there be a conflict when each VM should only be used for a single project?
hdra on
Thanks for the clearing up my 1st question.
hdra on