27👍
✅
As others have said, Celery can schedule tasks to execute at a specific time.
from celery.schedules import crontab
from celery.task import periodic_task
@periodic_task(run_every=crontab(hour=7, minute=30, day_of_week="mon"))
def every_monday_morning():
print("This is run every Monday morning at 7:30")
Install via pip install django-celery
👤Josh
3👍
You can either write a custom management command and schedule its execution using cron, or you can use celery.
👤samu
- Override existing django-admin command
- Can you declare multiple with variables in a django template?
- Django: Duplicated logic between properties and queryset annotations
- Django makemigrations and migrate on heroku server don't create tables
- Proper declaration of an empty Django PostgreSQL JSONField default value in migration file
- How to override Django admin's views?
- Using Django's ORM in a Celery Task
- Django Login POST hangs when i do HttpResponseRedirect (302)
Source:stackexchange.com