source code according to django book 2.0