In this episode, we ensure that users are logged in for all of the views that depend on request.user being a the current user instance, by wrapping our view in a login_required decorator. We also created a rudimentary navigation user interface. Finally, we added the ability to toggle event attendance.
Debugging
If you noticed, in this screencast there were a few points where I made mistakes and had to do a bit of debugging. I was able to debug them fairly quickly to determine what caused the error, but sometimes the answer is not as forthcoming. What should we do in that case? There are some really great tools and tutorials out there to guide you along the way of debugging Django. Here are some of my favorites.
- Eric Holscher's excellent Debugging Django screencasts.
- Simon Willison's post on the subject.
- A fantastic new debug toolbar from Rob Hudson.
- Every debugger's best friend: pdb.
Comments - 5 people have already said something. Join the discussion.
Björn said…
Great timing, checked for the new ep just a minute before packing up. Now I'll have something to do on the train on the way home. :)
Adam Rutkowski said…
@ Toggling Attendance screencast:
09:47, casting the POST parameter seems to be unnessecary work, which could be handled by the framework itself using view's extra options, since we expect event_id anyhow.
http://docs.djangoproject.com/en/dev/topics/http/urls/#passing-extra-options-to-view-functions
brixtonasias said…
Nice screencast - as always! Thanks for the good work. Can't wait for the next one!
wang said…
This series is awesome, thanks a lot and keeps going!
hardtop said…
Thanx a lot! Great way to teach python and django together. Using zip function for two lists is nice trick.