scuml / django-mail-panel Goto Github PK
View Code? Open in Web Editor NEWPreview mail in this panel for django debug toolbar.
License: Other
Preview mail in this panel for django debug toolbar.
License: Other
introduced in f7412df#diff-459ac435a223466b2249d03740b0e9c6R1
Even though classifiers
are listed in setup.py
, they're not there on PyPI: https://pypi.python.org/pypi/django-mail-panel
Maybe we should try uploading with a newer version of setuptools ?
(The python 3 classifier is required to list the package in the "Python 3" list on PyPI. Also this tool: https://github.com/brettcannon/caniusepython3 uses the classifier to check for python 3 support for a package)
This plugin fails for Django Debug Toolbar v3.1. Window opens, but the message list is no longer clickable and the content area never displays. I can confirm it is working in 2.2 for us.
I am not sure what I was doing wrong, I don't care enough about installing this to investigate, but I followed the install steps and it wasn't catching mail, so I switched back to using mailcatcher which is working (A ruby thing that you run and listens on a port and serves its own web ui).
I had EMAIL_*
settings left over from when I was using mailcatcher โ I removed those to see if that helped but still no dice, I would just get a panel that says no mail.
I just thought you should know, somehow mail was not being caught and I was sending regular Django EmailMultiAlternatives on Django 1.11.18. I didn't notice the collectstatic step first attempt, ran that, no difference.
I'll close this issue now so it doesn't kick around, I'm not going to investigate further because I'm a jerk / busy, but this didn't work for me, all the best with fixing it if you have any idea what was wrong from my vague description ๐ฌ๏ธ
After trying to add this package to one of my projects, I've got this error:
File ".../site-packages/mail_panel/backend.py", line 27, in send_messages
message.id = uuid4().get_hex()
AttributeError: 'UUID' object has no attribute 'get_hex'
It seems this package doesn't yet support python3. Is there any plan to make it compatible in the foreseeable future?
Django Version: 3.2.11
django-mail-panel==3.2.6
django-debug-toolbar==3.2.4
Exception Value: 'EmailMessage' object has no attribute 'alternatives'
I am using the django-tempalted-email 3.0.0 package to send an email:
send_templated_mail(...)
I attempted to fix it with:
try:
alternatives = message.alternatives
except AttributeError:
alternatives = None
super(MailToolbarBackendEmail, self).__init__(
subject=message.subject,
to=message.to,
cc=message.cc,
bcc=message.bcc,
reply_to=message.reply_to,
from_email=message.from_email,
body=message.body,
alternatives=alternatives,
headers=message.extra_headers,
)
The code assumes that a text/plain alternative is always available. If only HTML alternative is available, the mail display view breaks.
def54f8 introduced a check for caches.settings
, which was only introduced in Django 3.2.
I'm using the attach_inline_image_file
functionality of Anymail (see https://anymail.dev/en/stable/sending/anymail_additions/#inline-images), however, the inline images don't seem to appear properly in the debug toolbar's mail panel (neither in the body or as an attachment). The inline images otherwise work fine when sent and viewed with a regular email client.
There could be more instances of the use of the deprecated modules but this is the first I found:
dev | File "/usr/local/lib/python3.9/site-packages/mail_panel/panels.py", line 1, in <module>
dev | from django.utils.translation import ugettext_lazy as _
dev | ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/local/lib/python3.9/site-packages/django/utils/translation/__init__.py)
This comes from this: https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0
It appears that the attachments
argument is not being carried forward.
https://github.com/scuml/django-mail-panel/blob/master/mail_panel/backend.py#L20
should mirror:
https://github.com/django/django/blob/main/django/core/mail/message.py#L205
Like sending mails from an admin action. Console backend displays sent mails, but mail panel lists none.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.