Skip to content Skip to sidebar Skip to footer

Python Reportlab - Registerfont - Django - Font Not Available After Some Time

I'm wondering what is the best time to register a font for use in reportlab. I added the following line into my settings.py: pdfmetrics.registerFont(TTFont('Calibri', FONT_DIR + '/

Solution 1:

I don't know what anything about how reportlabs works, but I can say about django.

Django doesn't warrant that settings will be imported once (may be, there are any other problems) and it's not a good place for such things. Usually, urls.py is used for objects registration (for example, admin.autodiscover).

Post a Comment for "Python Reportlab - Registerfont - Django - Font Not Available After Some Time"