<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=338168267432629&amp;ev=PageView&amp;noscript=1">
Programming

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, …


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

pip install django-extensions

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:

https://pypi.org/project/django-extensions/

Similar posts

Get notified about the latest in Tech

Be the first to know about new tech from the experts at Bixly!