I have a web app on Django platform.
I have a method within views.py:
def task():
print("my task")
how can I run it every day once?
I need a very simple solution and it should be independent of other tasks (parallel).
I have a web app on Django platform.
I have a method within views.py:
def task():
print("my task")
how can I run it every day once?
I need a very simple solution and it should be independent of other tasks (parallel).
There are several libraries that help facilitate periodic tasks. Two that I have used are celery and django-q.
Celery is a general python task manager. Using it with django requires additional libraries to bring them together. Where as django-q is specifically for django projects.
On a side note, if the task()
function is not an actual view, then it belongs in a separate file other than views.py
.