This repository contains the code for version 2 of the "Web Development with Python and Django" tutorial session run by Mike Pirnat and David Stanek.
In this tutorial we'll build a 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. 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 Python 3.4.
Earlier versions of Python are not guaranteed to be compatible with the example code in this repository.
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 during the session.
If you're on Windows, you may need to update your PATH so that Windows can find your python.exe. This varies a bit between different versions of Windows so use the method that's right for your OS.
Since you installed Python 3.4, add:
C:\Python34\;C:\Python34\Scripts\;C:\Python34\Tools\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:
$ pyvenv django-tutorial-v2
$ cd django-tutorial-v2
$ source bin/activate
On Windows:
> pyvenv.py django-tutorial-v2
> cd django-tutorial-v2
> Scripts\activate.bat
- Clone this repository
In the django-tutorial-v2 directory from the previous step:
$ git clone https://github.com/mpirnat/django-tutorial-v2.git ./src
- Install Django and any other Python dependencies
In the django-tutorial-v2 directory from the previous step:
$ cd src
$ pip install -r requirements.txt
Or, on Windows:
> cd src
> pip.exe 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 exercise01.1
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 an earlier version of this tutorial as presented at CodeMash 2013 and 2014?
It's available from the original GitHub repository.
This tutorial was created by:
Based on the tutorial originally created with Mike Crute.
With gratitude to the Python and Django communities for their accomplishments.