Run Django command from cron

How do you call/ execute a custom Django management command from a cron job?

I have a webservice running Django with a custom command that I would like to run periodically. I have created a cron job but I am not sure how to reference the Django instance. Any help is greatly appreciated.

Hey there,

So cron services are their own instance - they don’t reference others instances. You’d have to setup the cron service with all the same code/vars etc as your web-service and then use the command you want as the cron command. If you’re sharing environment variables across services then using Environment variable groups are really helpful here,


John B

Thanks John, that is what I though

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.