O
O
Oleg Kotov2019-08-06 17:04:31
Django
Oleg Kotov, 2019-08-06 17:04:31

Where to write logic for periodic tasks?

Hello. Asked a question.
Let's say I have an application. Every day at 0:00 server time, it should access the service API, pull data and write to the database. Where to write this logic?
views.py, as I understand it, work out only when a request is made to them.
It is not recommended to write heavy logic in models.py. How to be in such a situation?
Django acts as a JSON server. The application is built on the concept of REST.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-08-06
@AgeofCreations

In management command or celery task .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question