Creating a Cron Job - Linux / Python

后端 未结 4 2122
南笙
南笙 2021-01-14 04:09

Hi I have a Django script that I need to run,

I think the commands could be called through bash.

Thing is the script causes memory leaks after a long a perio

4条回答
  •  生来不讨喜
    2021-01-14 04:33

    Have you taken a look at custom management commands for your django app? They work like any other command from manage.py, except you can write them.

    Applications can register their own actions with manage.py. For example, you might want to add a manage.py action for a Django app that you’re distributing.

    To do this, just add a management/commands directory to your application. Each Python module in that directory will be auto-discovered and registered as a command that can be executed as an action when you run manage.py.

提交回复
热议问题