Sql and cache tracking in local development for django
While developing django applications, did you ever get confused about the unexpected result by the query generated by ORM and wished to check that query? There is a good solution. I have a habit of watching #django at times and thats how I got to know about this. Its django-devserver. Package is available here - http://github.com/dcramer/django-devserver/. After installing(with dependancies) you need to include devserver in INSTALLED_APPS in your settings file as:
INSTALLED_APPS = (
'devserver',
)and also you have to add a new tuple in settings as DEVSERVER_MODULES. This is for specifying which all modules to load.
DEVSERVER_MODULES = (
'devserver.modules.sql.SQLRealTimeModule',
'devserver.modules.sql.SQLSummaryModule',
'devserver.modules.profile.ProfileSummaryModule',
# Modules not enabled by default
'devserver.modules.ajax.AjaxDumpModule',
'devserver.modules.profile.MemoryUseModule',
'devserver.modules.cache.CacheSummaryModule',
)You will have to use python manage.py rundevserver instead of python manage.py runserver to run your development server. Then you will get additional informations like real-time SQL-Loggings and a summary of your cache calls
Go through the Read Me file before installing.
NB:- Beware - your terminal may get spammed by the sql-logs :p
Happy coding!

