Django i18n and ugettext_lazy
=> str(ugettext_lazy(''))
'<django.utils.functional.__proxy__ object at 0x0>'
Ensure you're always working with unicode. For me, it turned out that a certain Django mail backend called str()
on the subject line of an email who was using i18n strings.
I had to manually coerce the values using unicode(ugettext_lazy(''))
in order for users to stop receiving emails with subject lines referring to memory addresses.
facepalm
Written by Adam Thurlow
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#