G
G
Grigory Dikiy2016-07-12 10:05:57
Django
Grigory Dikiy, 2016-07-12 10:05:57

How do I catch the add data event through the Django admin?

Good day. There was a task of the following type: there is a blog, in it I created a model for subscribing to an email newsletter. It is planned that when adding an article through the admin panel, launch a function that would go through all subscribers and send them a letter about adding. How can I catch the addition?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Lebedev, 2016-07-12
@frilix

It is possible via signals (see the answer above), but I would override the save_model() method and call the dispatch from there with an asynchronous task via celery ( www.celeryproject.org/)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question