Django Extensions is a collection of custom extensions for the Django Framework. These include management commands, additional database field, admin extensions and much more. One command that I’d like to highlight in this post is
runserver_plus, which makes debugging a lot simpler when you’re trying to figure out what in the world is wrong in your code.
Let’s try it out in our command line:
First, you will need to install
django_extensions. You should then add django_extensions to your
INSTALLED_APPS in your
settings.py. Now that you have everything installed, you can use additional management commands such as
Let’s take a look of this in the browser. There’s a normal series of errors, but the color schemes are different. Notice that there is an icon terminal in the error snippet. Clicking it opens a prompt and you can start typing.
Basically, you have a console in your browser, which makes basic requests to the command line and returns the result. Think of this as an ipdb breakpoint and each of these points of the code.
This is very powerful because it can make debugging a lot simpler, instead of having to manually put
import ipdb; ipdb.set_trace().
📬 Get updates straight to your inbox!
Subscribe to my newsletter to make sure you don't miss anything.