django-celery-beat

Django run tasks (possibly) in the far future

时间秒杀一切 提交于 2021-02-07 05:39:17
问题 Suppose I have a model Event . I want to send a notification (email, push, whatever) to all invited users once the event has elapsed. Something along the lines of: class Event(models.Model): start = models.DateTimeField(...) end = models.DateTimeField(...) invited = models.ManyToManyField(model=User) def onEventElapsed(self): for user in self.invited: my_notification_backend.sendMessage(target=user, message="Event has elapsed") Now, of course, the crucial part is to invoke onEventElapsed

Is it possible to use django-celery-beat with django-tenant?

穿精又带淫゛_ 提交于 2021-01-28 21:09:36
问题 I am using celery for scheduling tasks. So far everything was fine, including hosted on AWS. However, I decided to transform my single application to multi tenant, using django-tenant. That way, I can create the subdomains perfectly. ./manage.py create_tenant However, when running the command celery -A myproject worker -B , despite not showing me any error, It seems to me that he cannot run for the created schema (test with only one created). I tried to specify the schema, using python manage