added one line to views.py which stopped the errors? See pgs 25-26