Top 5 Favorite Django Modules
Recently updated on
Of all the Django modules that are out there, several stand out as ones that I keep coming back to. These are some of my favorites:
Django Debug Toolbar
Django Debug Toolbar is an extremely useful Django application for debugging a site from “Django’s perspective.” It should only be used during the development of a site. This toolbar overlays an expandable menu over every page of your website. Upon expanding this menu, you can see all of the request variables and settings variables associated with that page. Also, it allows you to view every single database query that takes place as part of each page request. This is extremely useful for determining what to cache and optimize on your pages. Debug Toolbar is an app that should be in every Django developer’s toolkit.
Django Rosetta
This is a very useful tool that provides you a Web interface to utilize Django’s translation framework. Instead of modifying translation files on the server by hand, the Web-based interface makes translating a breeze, even for non-technical users with no programming background. Rosetta even provides a means to look up translation strings via Google Translate as a starting point for translation. Django Rosetta is, indeed, a very nice tool for international sites.
Django Compress
Django Compress simplifies the process of creating optimized JavaScript and CSS code. Django Compress groups and compresses multiple CSS or JavaScript files together into one file. A simple, yet flexible setting in settings.py allows you to set which files should be grouped and what the filename of the combined file should be. That group can then be referenced in a template tag which then includes the combined JavaScript/CSS file in your Django template. Compress can automatically regenerate the combined files any time you make changes to any of the component files. It leverages YUI or CSSTidy to do the compression. Compress can also generate the resulting file with a random number in filename to take advantage of FarFutureExpires caching at the webserver level. Definitely a nice module for those concerned with website optimization.
Django Command Extensions
I feel that Django Command Extensions should be installed on every site that I develop. This module adds about 20 management commands to manage.py. By far, the command I run the most is “shell_plus” which executes a normal shell but also automatically imports all models available in the Django project. The “show_urls” command is also an extremely useful command which parses all of the URLs in your project and displays them, along with the views associated with them. The “graph_models” command utilizes GraphViz to generate an image of how all of your Django models relate to each other. This command is essential for creating a quick but informative view of your Django models. There are many other management commands available that make this module worth installing in every Django project.
Django South
Django South is an invaluable tool that helps you migrate (make changes to) Django database models. Not only does it ease the pain of creating tables and altering columns, it also allows you to safely transform your data to fit your new model structure. South makes deploying your changes easy since it allows you to issue a single command to deploy your database changes, yet is flexible enough to be very customizable. South is definitely the way to go for growing projects.