DJango Error Reporting in production – Sentry

< 1 min read

If you are a developer, probably you have heard about sentry. Generally, you can find errors while in development machine by debugging your code. It is equally same important to have a visibility on production errors as solving issues in application. In production, we have a tons of way to log errors.

Sentry is a great tool for many platforms in production, which monitors and logs all the errors and provides a way to report to the admin by email. When you signup for sentry, you will get one free account which mostly sufficient for any new or average lifted application. But if your application scales well, you have always option to upgrade the plan. Sentry provides a nice dashboard where you can see all the errors coming in. You can create alert to your team members email.

In sentry, you can tag the errors so you can filter errors in dashboard or filter when sentry client send the errors to the sentry server.

I use sentry in my DJango backend application server, Celery and nginx which gives me a strong confidence not to worry about what’s happening under the hood in production.

Configuring sentry is easy and straightforward process. Sentry has build libraries specific to different platforms. For django, you can install the django sentry library. You can find the supported platforms here and django integration here.

Setting up sentry is as easy as specifying the sentry URL. After you signup for sentry, you need to create project. For each project, sentry provides you which they call DSN. This is a URL to which sentry report the errors. Once you have got the sentry DSN, that’s enough for you to set it all in your project.

Enjoy cracking your production errors!

Leave a Reply

Your email address will not be published.