From 68ba9208828ca197b559fc89bb9c0403038ba910 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 24 Sep 2022 22:52:00 +0100 Subject: [PATCH] Fix matplotlib generation --- src/purchase/views/reports.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/purchase/views/reports.py b/src/purchase/views/reports.py index 2e4ab34..fcb51e4 100644 --- a/src/purchase/views/reports.py +++ b/src/purchase/views/reports.py @@ -2,6 +2,7 @@ import datetime from io import StringIO from zoneinfo import ZoneInfo +import matplotlib import numpy as np from django.conf import settings from django.contrib import messages @@ -17,6 +18,8 @@ from matplotlib.figure import Figure from purchase.models import Basket, PaymentMethod, Product, ProductQuerySet +matplotlib.use("TkAgg") + @permission_required("purchase.view_basket") def reports(request):