Unknown command: 'run_daily_task'

i created a management directory in my project root directory and inside it i created a command directory to place the file run_daily_task.py inside it and make it run daily
how ever when i try to run it by typing (python manage.py run_daily_task) in the terminal it gives me the error: Unknown command: ‘run_daily_task’
Type ‘manage.py help’ for usage.

this is what run_daily_task looks like:

from django.core.management.base import BaseCommand
from Hiral.my_daily_task import my_daily_task

class Command(BaseCommand):
    help = 'Runs my daily task'
    def handle(self, *args, **options):
        my_daily_task()  ```

Have you tried putting this management command inside an app instead of in your project root?

Yes i tried to put it in the main app but it also didn’t work

The docs at How to create custom django-admin commands | Django documentation | Django explain the directory structure needed. (Note, don’t just describe the directory structure, specify what you’ve done.)

i am trying to run a task daily that should update information about my users and i have tried celery for task scheduling and it didn’t work because i’m working on windows. any suggestions of a good way to schedule the task?

Use the Windows task scheduler.