Skip to content

Instantly share code, notes, and snippets.

@econchick
Last active December 28, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save econchick/7525444 to your computer and use it in GitHub Desktop.
Save econchick/7525444 to your computer and use it in GitHub Desktop.
Installation & Setup instructions for PyLadies Stockholm's Django workshop on Nov 19th, 2013 @ Spotify.

PyLadies Stockholm: Build your own Blog with Django

Installation

  1. Download & install VirtualBox for your machine here.
  2. Download & install Vagrant for your machine here.
  3. Download the PyLadiesDjango virtual machine here. Do not open this file NOTE: Remember where you downloaded this PyLadiesDjango virtual machine.
  4. If you don't have a text editor (like Notepad++, TextEdit, TextWrangler), I highly recommend Sublime Text 2, which can be downloaded here.
  5. Continue to Setup below when you're all set with downloading & installing.

To read while you're waiting for everything to download.

What does this all mean?

  • 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!

An FYI for the not-so-n00b

Go ahead and skip this section if virtual machines are new to you.

  • 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 within DjangoProj will be reflected within /home/vagrant/DjangoProj on the VM, and vice-versa. All code-work will be done locally within DjangoProj, 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.

Setup

Setup some folders

  • 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!

Setup virtual machine

  • 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, where lynn 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. :)
  • 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.

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment