This repository contains the code for the "Web Development with Python and Django" tutorial session run by Mike Pirnat and David Stanek at CodeMash 2013 and 2014.
This is NOT the CodeMash 2015 version.
In this tutorial we'll build a full-featured website step by step using the Django web framework.
If you're attending the tutorial in person, please make sure you install these prerequisites before the class begins so that we can make the most of our time together in the session. You and your fellow attendees will thank you for your preparedness!
You'll need to install:
Django is written in the Python programming language; you'll need to install Python in order to make anything work.
You should install either Python 2.7 or Python 3.3.
You will need the Git version control system in order to work with the exercises in this repository. If you're new to Git, don't panic--we won't be doing anything too weird, and we'll walk through all of it in the session.
Pip is a tool for installing Python packages. You will need it to install the Python dependencies for this tutorial.
Virutalenv is a tool for creating isolated Python environments on your system. This allows you to work on multiple projects that might have conflicts in the versions of libraries they depend on. It also keeps your base system installation of Python nice and clean.
If you're on Windows, we recommend following these instructions to get Python, Pip, and Virtualenv going.
Be sure to update your PATH! This varies a bit between different versions of Windows so use the method that's right for your OS.
If you installed Python 2.7, add:
C:\Python27\;C:\Python27\Scripts\
If you installed Python 3.3, add:
C:\Python33\;C:\Python33\Scripts\
Once you have installed these basics, let's get the working environment set up for the project. Time to open up a command line! (Terminal in Mac OS X, good ol' "cmd" in Windows.)
- Create a new virtual environment ("virtualenv") and activate it
On Linux or Mac OS X:
$ virtualenv django-precompiler
$ cd django-precompiler
$ source bin/activate
On Windows:
> virtualenv django-precompiler
> cd django-precompiler
> Scripts/activate.bat
- Clone this repository
In the django-precompiler directory from the previous step:
$ git clone https://github.com/mpirnat/django-tutorial.git ./src
- Install Django and any other Python dependencies
In the django-precompiler directory from the previous step:
$ cd src
$ pip install -r requirements.txt
- Check to make sure everything's in good shape
In the src directory from the previous step:
$ python prerequisites.py
On Windows, that looks like:
> python.exe prerequisites.py
- Rewind the repository to the start of our exercises
In the src directory from the previous step:
$ git reset --hard ex00
You should now be ready for the tutorial!
The current slides that accompany this tutorial are available for viewing and downloading.
If you need help getting set up, please contact Mike Pirnat (mpirnat@gmail.com) and David Stanek (dstanek@dstanek.com). Please make sure to copy both of us so that we can make sure you get the best answer as soon as possible.
Looking for a different version?
- Version 2, as presented at CodeMash 2015
This tutorial was created by:
With gratitude to the Python and Django communities for their accomplishments.