- Download & install VirtualBox for your machine here.
- Download & install Vagrant for your machine here.
- Download the PyLadiesDjango virtual machine here. Do not open this file NOTE: Remember where you downloaded this PyLadiesDjango virtual machine.
- If you don't have a text editor (like Notepad++, TextEdit, TextWrangler), I highly recommend Sublime Text 2, which can be downloaded here.
- Continue to Setup below when you're all set with downloading & installing.
- Virtual Machine is a computer within your computer. You are able to create virtual machines to run many different types of operating systems, like Ubuntu, Fedora, and Debian, regardless if you own a Windows machine, a Mac, or a Linux machine.
- In Installation Step #1, you downloaded VirtualBox. VirtualBox is free software that allows you to run virtual machines on your computer.
- For our workshop, we are running the Linux flavor called Ubuntu 12.04. Why? Because Linux-type environments make it really easy for Python development. Also, Ubuntu is one of the most popular Linux-flavors out there within the developer circles. It's very well supported.
- Vagrant, which you downloaded & installed in step 2 above, is a tool that developers often use to work with virtual machines. It pairs nicely with the VirtualBox software that we downloaded.
- All you need to know about Vagrant is that it makes it very easy to create virtual machines, so that I am able to give you an Ubuntu virtual machine that is ready to go for today's workshop.
- You may hear me refer to the PyLadiesDjango virtual machine (downloaded in step 3 above) as a "box" or a "vm". These are the same things.
- You are able to reuse this virtual machine whenever you'd like!
- The vagrant box, "PyLadiesDjango", has python, pip, virtualenv, and virtualenvwrapper installed. The whole system as also been updated as of Nov 18th, 2013.
- It also already as a "synced folder" setup, linked locally to
DjangoProj
, and on the VM to/home/vagrant/DjangoProj
. Any changes locally withinDjangoProj
will be reflected within/home/vagrant/DjangoProj
on the VM, and vice-versa. All code-work will be done locally withinDjangoProj
, and run within the VM. - The virtualenv "DjangoProj" has also already been created, with Django 1.6 installed.
- The virtual machine is setup to forward to port 8080 on the local machine from port 80 on the vm. Therefore, if you have a server running within the virtual machine, you will be able to see it on
localhost:8080
on the local machine.
- Create a "pyladies" folder anywhere that you prefer. Take note of where you created that folder.
- Move the PyLadiesDjango virtual machine to the "pyladies" folder.
- Within the "pyladies" folder, create another folder called "DjangoProj". NOTE: spelling and capitalization is important here!
- Open up your command line program:
- For Windows, click "Start", then select "run". Type "cmd" and press enter. You should see a screen with
C:\Users\lynn>
prompt, wherelynn
is actually your username. - For Mac, press "COMMAND+Space Bar" at the same time; you should get a "Spotlight" finder that pops up to the upper-right. Type "terminal" and press enter. You should just see the
$
prompt. - For Linux: I trust that you know where your terminal/shell is. :)
- For Windows, click "Start", then select "run". Type "cmd" and press enter. You should see a screen with
- Navigate to the "pyladies" folder that you created:
- Windows: For instance, if you created the "pyladies" folder within "My Documents", then within the CMD/Command Prompt, type
cd C:\Documents and Settings\<username>\Desktop\My Documents\pyladies
. Be sure to put in your own username for<username>
. The actual command/path may be different depending on capitalization, spelling, and actual location of where you put the "pyladies" folder. - Mac: For instance, if you created the "pyladies" folder within "Documents", then within your terminal, type:
cd Documents/pyladies
. - Linux: Very similar to Mac, but perhaps your file heirarchy/path is different.
- Windows: For instance, if you created the "pyladies" folder within "My Documents", then within the CMD/Command Prompt, type
Finally: In the terminal/command line, type the following commands. Make sure that you are 1) within the "pyladies" directory, and 2) you moved the "PyLadiesDjango.box" file that you downloaded above within the "pyladies" directory. Note that each command may take a while. You must wait for the process to finish before proceeding to the next command:
vagrant box add PyLadiesVM PyLadiesDjango.box
vagrant init
This creates a Vagrantfile
within this directory, pyladies
. Open up the Vagrantfile
in your text editor, and replace this bit (around line 13):
# <-- snip -->
config.vm.box = "base"
# <-- snip -->
With this:
# <--snip -->
config.vm.box = "PyLadiesVM"
# <--snip -->
And save & close. Then back in your terminal, run:
vagrant up
You now have a virtual machine called "PyLadiesVM" using the "PyLadiesDjango" box that I gave you in step 3 of the installation process!