In our website we want to create hourly reports for our users, our first solution was this (I'm using celery for that):

here is what I use for creating report for a single user:

@app.task def create_report(user): # this method creates report for given user pass

and then I created this cron task, celery runs this task every 60 minutes:

@app.task def report_cron(): for user in User.objects.all(): create_report.delay(user)

this soultion adds the whole table of users into celery queue (we are using rabbitmq).

currently this solution works fine (we don't have lots of user) but can you help with a better solution for this problem?