[Answered ]-Sending a lockfile to django-post_office send_queued_mail

1👍

I’m sorry to hear your problem, but the problem is located in the management command. You see, the KeyError means the ‘lockfile’ does not exist in the dictionary. Further investigation yields that the root cause of the problem is in the management command. The management command syntax is valid only for Django 1.8 and up. They’re currently dropping support for Django < 1.8. Hope this helps !

1👍

I had the same issue using django-post-office. Downgrading to versions (1.1.2, 1.1.0, 1.0.0) also didn’t help.

FYI, I was using Python 2.7.7 and Django version (1, 4, 2, ‘final’, 0)

I tried django-mailer instead. Link Here and it worked like a charm. Followed the same steps used with django-post-office.

pip install django-mailer

Added the following to my settings.py file

INSTALLED_APPS = [
    ...
    "mailer",
    ...
]

EMAIL_BACKEND = "mailer.backend.DbBackend"

After, I ran this command

python manage.py syncdb

It created the following tables:

Creating table mailer_message

Creating table mailer_dontsendentry

Creating table mailer_messagelog

No change is further required in your code.

After i sent some mails in my application, they were added to the db table mailer_message

To send those emails, i used the management command added by django-mailer

python manage.py send_mail

After the messages were sent, they were removed from the db table and added to the logs table – mailer_messagelog instead. You could create a cron job to run this command after a given interval of time.

Hope this helps.

0👍

Short answer that helped me:

reload your computer

With details:

I encountered same error while trying to send emails with send_queued_mail command. But previous to it i changed my settings and this library froze.
I tried to reload project but only reloading my computer helped, i encountered this error twice, and reloading computer solved problem.

Leave a comment