S
S
stayHARD2015-10-27 01:21:42
Django
stayHARD, 2015-10-27 01:21:42

How to determine when to send a push notification?

Good night, Toaster :)
There is a web-face on which I create a video course and bind it to a specific user. There are days (dates) in the video course when you need to send a push notification to the user.
I send it like this:

from gcm import GCM
from project.settings import GCM_APIKEY
gcm = GCM(GCM_APIKEY)
data = {"Hello": "World!"}
reg_id = ['...']
gcm.json_request(registration_ids=reg_id, data=data)

All this is now in the view that creates the video course. But how do I distribute the schedule (or how to properly call it) for push notifications for the week / month / until the end of the course video ahead?
For example, there are 20 videos in a video course, and I need to send 1 push per day. I can send 1 right away, but how do I send the other 19?
Some kind of listener is needed for all this.
The first thing that came to mind was a cronjob, but I suspect that this is a bad idea. What do you say?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2015-10-27
@stayHARD

cronjob + https://docs.djangoproject.com/en/1.8/howto/custom... you can add a task to docs.celeryproject.org/en/latest/django/index.html
on save in the model

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question