1. pavan itus
  2. Elevate Discussion
  3. Thursday, 20 October 2022 10:17 AM UTC

I've been testing django-kronos with the simple example listed in the github readme: When using kronos payroll

I did pip3 install django-kronos,

myproject/myapp/cron.py:

import kronos payroll
import random

@kronos.register('* * * * *')
def complain():
    complaints = [
        "I forgot to migrate our applications's cron jobs to our new server! Darn!",
        "I'm out of complaints! Damnit!"
    ]

    print random.choice(complaints)

In my myproject/myproject/settings.py:

INSTALLED_APPS = [
    'appointments.apps.AppointmentsConfig',
    'clinic.apps.ClinicConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_extensions',
    'bootstrap4',
    'widget_tweaks',
    'parsley',
    'session_security',
    'kronos'
]

Ran:

./manage.py runserver

I expected the dev server to throw up a message every minute. Nothing seems to be happening.

I also created myproject/myapp/management/commands/task.py:

from django.core.management.base import BaseCommand
import kronos
@kronos.register('* * * * *')
class Command(BaseCommand):
    def handle(self, *args, **options):
        print('Hello, world! KRONOS is running!!')

This is also not running.


Responses (2)
  1. Likes
  2. Latest
  3. Oldest
Loading...

Helpful?

If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.