It turns out that SendGrid—since it is my email backend (django-sendgrid-v5
) and was being used when mail_admins()
was being called by the Django's logging module (django.utils.log
) every time a server error occurred—was taking anything that looked like a URL and replacing it with a click-tracking URL because django-sendgrid-v5
's default behavior is to tell the SendGrid API to do that.
The solution was to set these variables in settings.py
:
SENDGRID_TRACK_CLICKS_HTML = False
SENDGRID_TRACK_CLICKS_PLAIN = False