Going from web pages to web apps with Python (aka, Django for Designers)

Last week at PyCon 2013, with the assistance of Asheesh Laroia and several other helpful TAs, I delivered an introductory Django tutorial wherein one builds a simple bookmarking application. Instead of the official Django tutorial, I used a different curriculum based on the tutorial I wrote for my IOLab students in fall 2011 (itself based on the PyStar Django tutorial).


The idea was to write a web development tutorial targeted at a group of students who were familiar with HTML, CSS, and perhaps Javascript and had had some introduction to Python, but had little to no experience with databases or server-side code. Thus, the tutorial skips over some of the traditional tutorial’s topics (e.g. the built-in admin) and emphasizes other areas: static files, CRUD, Django forms, using asynchronous Javascript with Django, and the Django templating language. It also incorporates non-core-Django topics such as git-based version control, database migrations using South, and sharing your work with others both locally and using Heroku.

The version control aspect was especially key, as it allowed me to set up “checkpoints” where everyone would be working from the same copy of the code, even if they hadn’t managed to get part of the code working in their personal branch. Given that PyCon tutorials have a single lecturer/large room structure, rather than small pods or groups, that sort of thing is kind of necessary–you have to keep a pace, even when a few students might not have gotten a step in your tutorial working yet.

I also had a goal of making it so that literally everything you had to type into the command line or your text editor to get the tutorial app to work was available for copy and paste on the tutorial wiki. (It’s not quite true–I think there are some steps in the laptop setup guide that don’t qualify for this, and most of the commits aren’t spelled out–but it’s pretty close. The cheatsheet also helped to fill in any gaps.) This was important not just for speed — to get through all the material, typing all the HTML, etc. out by hand would have been prohibitive — but also so that if a student had trouble in one of the sections, or if the class didn’t make it through all the material (we didn’t, and that was expected, and there are a bunch of “reader exercises” at the end of the tutorial that weren’t meant to be taught in class at all), she would still have everything she needed to revisit it later.

With every runthrough of the tutorial I find more things to fix and tweak, and there’s definitely cleanup and improvements I want to make post-PyCon. Still, I’m pretty proud of the tutorial Asheesh and I (and playtesters Shauna and paultag!) put together, available on the web for free via the OpenHatch wiki and licensed under a permission CC license. I hope other people make use of the tutorial curriculum and (shudder) video too, either to teach or to learn!