django-extensions: Like Shortcuts for Django

Like many good apps, django-extensions either adds minor functionality or simplifies something django was already capable of doing. Some built-in Django functionality is misunderstood, misused, or simply ignored for difficulty, some are just plain tedious.

At one point or another, every developer goes through these steps: Faced with a simple, common problem, the developer opens up the shell and solves the problem with a few lines of code, and fixes it…until it happens again.

These events are so common that few would bother to implement shortcuts, because they’re not exactly hard to solve, and happen infrequently enough that few devs bother to speed up the process. But minutes are precious, and over time these few minutes add up.

Enter django-extensions.

(See video for a quick run-through of what django-extensions is all about.)

http://ericholscher.com/blog/2008/sep/12/screencast-django-command-extensions/

django-extensions basically does a lot of work that would be otherwise be just repetitive and tedious typing. It also does some things that couldn’t be put under the same job description as a ‘normal’ django app, such as printing a graphic visualization of your models.

Installation

then, include it in INSTALLED_APPS as ‘django_extensions’

A Few Examples

shell_plus – This loads up all your models. Short, sweet, and very useful. It also adds __autocomplete__!.

create_app – A tool that would be very familiar with ruby veterans – creates the application directory structure given the app name.

reset_db – it’s a lot easier to do this than manually dropping tables.

Some useful references

Full list:

https://github.com/django-extensions/django-extensions/wiki/Current-Command-Extensions

Verbose Descriptions:

http://packages.python.org/django-extensions/