DEV Community

Cover image for Using Exceptionite 2 in Django with a single line
Joseph Mancuso
Joseph Mancuso

Posted on

Using Exceptionite 2 in Django with a single line

Introduction

Exceptionite 2 is a debugging screen package written by the Masonite team. Although written by the Masonite maintainer team, it can be used in Flask, Django and of course Masonite.

Starting in Masonite 4.9 this is the default debugging screen and it comes with a lot of amazing features.

  • Detailed solutions for common or framework specific issues
  • Easy to ready stack traces to see exactly which frames were hit
  • Easily click any line in the stack trace to open that line in your editor
  • Detailed environment and framework specific information
  • Easily copy detailed information to quickly paste and share with your team or community.

Notable Features

Before we go into how to quickly install Exceptionite into your Django project I'd like to go over some notable features in a bit more detail.

Sharing detailed errors

Sometimes when you hit an exception and you can't figure it out you tend to go to people that can figure it out. Maybe these people are you coworkers or maybe they are a group inside a Discord server.

In the top right you can click the Share Error link:

Share Error Link

This will open a popup where you can easily select the important information you want to be put on your clipboard so you can paste the info later:

Share Error Popup

You can copy this information either as "Raw" (just bullet points and text) or as markdown.

Solutions

Another awesome part of Exceptionite is the ability to see solutions to your exception in the first place. This is like having someone over your shoulder giving you suggestions while you develop your application.

Solutions To Errors

Clicking on a stack trace line

One of the amazing features is to click on a stack trace line and be able to open that line up directly in your editor to quickly start fixing

Stack Trace Line

Open in Editor

Dark Mode

Thought this package couldn't get cool enough? It comes with a dark mode:

Dark Mode

Installing it in your Django project

Having Exceptionite 2 serve your debug exception screen is extremely simple.

  1. Install Exceptionite:
pip install exceptionite
Enter fullscreen mode Exit fullscreen mode
  1. Set the Django exception report as the DEFAULT_EXCEPTION_REPORTER in the settings.py file.
# mysite/settings.py

DEFAULT_EXCEPTION_REPORTER = "exceptionite.django.ExceptioniteReporter"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)