User:Babbage Linden/Django/Debugging

From Second Life Wiki
Jump to navigation Jump to search

Django provides lots of debugging facilities.

When an error occurs during development the default 500 template provides error descriptions, stack traces with expandable code sites and detailed request information.

The test client can be used in the interactive debugger to examine responses.

import pdb; pdb.set_trace()

Can be inserted in code to cause the development server to drop in to the interactive debugger.

Django version 1.0.1 final, using settings 'region-django.settings'
Development server is running at http://station-etch-3:9999/
Quit the server with CONTROL-C.
> /var/tmp/babbage/scalable-space-services-1/indra/web/apps/region-django/presence/rest.py(16)region_GET()
-> return {'region_id': simulator.region_id,
(Pdb)

SQL queries executed by django can be examined.