We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please help us help you by filling out any applicable information in this template and removing the rest!
Request to add some info to the docs
A section for django-celery-beat periodic tasks
Since the docs mention that additional integration examples would be welcome, and I don't know how to make a proper PR:
from django.core.management.base import BaseCommand, CommandError from django_celery_beat.models import CrontabSchedule, PeriodicTask import pytz class Command(BaseCommand): help = 'Creates crontab schedule objects and periodic tasks that use them' def handle(self, *args, **options): every_day, _ = CrontabSchedule.objects.get_or_create( minute='0', hour='0', day_of_week='*', day_of_month='*', month_of_year='*', timezone=pytz.timezone('UTC') ) PeriodicTask.objects.get_or_create( crontab=every_day, name='Backup DB', task='myapp.tasks.backup_db', ) PeriodicTask.objects.get_or_create( crontab=every_day, name='Backup Media', task='myapp.tasks.backup_media', )
from celery import Celery from django.core import management app = Celery() @app.task def backup_db(): management.call_command('dbbackup') @app.task def backup_media(): management.call_command('mediabackup')
If you have opened a pull request to address the issue, please link it here.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Feature Request
Please help us help you by filling out any applicable information in this template and removing the rest!
Is your feature request related to a problem?
Request to add some info to the docs
Describe the solution you'd like
A section for django-celery-beat periodic tasks
Additional context
Since the docs mention that additional integration examples would be welcome, and I don't know how to make a proper PR:
django-celery-beat
myapp/management/my_custom_command.py (can be called on app startup)
tasks.py
PR link
If you have opened a pull request to address the issue, please link it here.
The text was updated successfully, but these errors were encountered: