Skip to content

Library does not work #93

@kennyhei

Description

@kennyhei

I have

  • Django 5.2
  • Django-q2 1.7.6
  • Python 3.13

I did the basic setup as instructed in the documentation and nothing happens. What I did:

  1. I created new app scheduler with python manage.py startapp scheduler
  2. I registered the app in INSTALLED_APPS
  3. I created tasks.py file where I placed following code:
from django_q.models import Schedule
from django_q_registry import register_task

print("register?")


@register_task(
    name="Send hello world",
    schedule_type=Schedule.CRON,
    # https://crontab.guru/#*/5_*_*_*_*
    cron="*/5 * * * *",
)
def test_hello_world():
    return "HELLO WORLD!"

I can see from runserver logs that print command so the code from tasks.py is loaded but nothing happens. I presume that this should create new Schedule object but there's nothing when I checked from admin panel. Really mysterious as running this code is not even giving me any errors or anything.

Also tested with registry.register, same thing, nothing happens.

EDIT: I can even write it like this and still no errors

from django_q_registry import register_task

@register_task()
def test_hello_world():
    return "HELLO WORLD!"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions