Custom commands

Folders

Name your custom command with a descriptive name, something that reflects its functionality.


my_custom_command.py




Run the command

python manage.py my_custom_command



Optional command scheduler

You can schedule your custom commands at specific times or intervals. You can use a third-party library like Celery or Django Q.

If your project is hosted on a platform that supports scheduling, such as Heroku, you can utilize their built-in schedulers instead of implementing your own. This is a simple and efficient solution that can save you time and effort. For example, if you host your project on Heroku, you can use their scheduler add-on ( https://devcenter.heroku.com/articles/scheduler ) to schedule tasks to run at specified intervals.




EXAMPLE

Folders




all_users_wealth.py




Run the command

python manage.py all_users_wealth