« Screencast 2: Logging in Django, for fun and profit | Using pdb to debug management commands and unit tests (Debugging Django Series,Part 4) »
I had a couple of comments about my last post saying that I should be sending all of the screencasts to the aggregator because this is content and isn't spam. So I'm going to do that. Thanks for all the feedback everyone! Hope you're enjoying the series.
No setup today. pdb is included with python, so everything that you need is available at a python install near you.
You can download the video here (17MB mov)
3: Using pdb from Eric Holscher on Vimeo.
I started the show by talking about a little bash alias that I made to be able to run the testserver from anywhere. Here is that code, edit accordingly:
alias rs='/usr/bin/python ~/EH/manage.py runserver 67.207.139.9:8000 --settings settings_debug'
In order to get into the debugger, you need to call it inside of any of your python code.
import pdb
pdb.set_trace()
Then I go in to talk about the basic Pdb commands:
I had about double the content that is in this screencast to talk about pdb. It is incredibly powerful and there are lots of other neat things you can do with it. This screencast was running a decent length already, so I decided to split it into 2 parts. This is more of the "Intro to pdb" part, and tomorrow, I will be presenting a little bit more advanced/different use case for the debugger.
Stay tuned and have a good labor day weekend if you're in America. Cheers!
Posted at 12:36 a.m. on August 31, 2008
Comments: 6
Tags: debugging , django , pdb , python , screencast
Screencast: Debugging with the Django Error Page
Screencast 2: Logging in Django, for fun and profit
Using pdb to debug management commands and unit tests (Debugging Django Series,Part 4)
Welcome to the home of Eric Holscher on the web. I talk about software development, mostly in the realm of Django. I am interested in the real time web, testing, mobile apps, and other things.
Why Read the Docs matters
1 week, 5 days ago (Comments: 7)
Read the Docs Update
9 months, 4 weeks ago (Comments: 2)
Using Reviewboard with Git
1 year ago (Comments: 0)
Read the Docs Updates
1 year ago (Comments: 1)
Handling Django Settings Files
1 year ago (Comments: 12)
Required Reading
1 year, 2 months ago (Comments: 0)
Using Haystack to index non-database content
1 year, 2 months ago (Comments: 4)
Correct commands to check out and update VCS repos
1 year, 2 months ago (Comments: 0)
Site upgrades
1 year, 2 months ago (Comments: 0)
Building a Django App Server with Chef: Part 4
1 year, 2 months ago (Comments: 1)
Setting up Django and mod_wsgi
Building a Django App Server with Chef: Part 1
Screencast: Django Command Extensions
Big list of Django tips (and some python tips too)
Handling Django Settings Files
Lessons Learned From The Dash: Easy Django Deployment
Large Problems in Django, Mostly Solved: Delayed Execution
Building a Django App Server with Chef: Part 2


Comments
1 block says...
This series has been really useful for me especially with upgrading apps to django 1.0. Keep up the good work!
Posted at 12:51 a.m. on September 2, 2008
2 travis cline says...
ipdb ftw man
Posted at 3:41 a.m. on September 2, 2008
3 Manish says...
I am really grateful that you did a nice session on debugging. Coming from a .NET background, pdb was scary at first.
Posted at 8:57 p.m. on September 4, 2008
4 Steve says...
one of the better screencasts i've seen in a while
good taste in music as well ;)
Posted at 6:13 a.m. on September 11, 2008
5 Gábor Farkas says...
hi, great screencast.
regarding the cannot-change-local-variables.
i found this: http://mail.python.org/pipermail/python-list/2004-Septemb...
in short: changing them works, but if afterwards you READ them in the debugger, then their values are reset to the original.
i tested it in a small (non-django) script, and it worked like that.
Posted at 8:45 a.m. on October 9, 2008
6 Patrick says...
Brilliant. I never understood pdb until today. Thanks
Posted at 7:51 a.m. on October 10, 2008