-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting 'can't pickle lock objects' using async() #38
Comments
Good morning. I think the connection object is the problem.
It's also better to use a dotted string path to your mail function e.g. 'fysiografen.mail_utils.send_single_correspondence', this will make sure it gets freshly imported when called by the worker. |
Since I'm most likely won't change the connection (sending these through Mandrill), I put the
Thank you for the tip, I didn't know this! Thanks so much for your work, django-q is so much nicer to work with than celery! |
Hi Legends, if you're searching "Django Q pickle error" and end of here, this thread helped me fix my error.
|
I am trying to send emails using django-q, but am getting a "TypeError: can't pickle lock objects" error trying the below. It works without the async. Sorry if I'm stupid, but I can't get this to work :/
Method for sending single email
and the async call
Probably not important, this is just a class that's overridden to handle attachents better:
The variables sent to
send_single_correspondence
are:subject: u'Async sending 12:23'
text_content: 'Message body'
html_content:
u'<p>Message body</p>'
from_email: u'fromemail@example.com'
recipient: u'toemail@example.com'
connection:
<django.core.mail.backends.smtp.EmailBackend object at 0xb49aa0c>
Traceback:
And here's the faulting line:
Perhaps I'm going about this the wrong way? It seems that I'm missing some information on the restrictions for django-q...?
Thanks for looking into this!
The text was updated successfully, but these errors were encountered: