B
B
bituke2021-03-09 18:54:54
Django
bituke, 2021-03-09 18:54:54

How to call a third party function that will run in the background in django?

I wrote a parser script that parses data and performs certain manipulations with them.
I have a django site.
I wrote a function that will parse information every 30 seconds and, under certain conditions, add them to the database.
How it's implemented:

while True:
     #выполняется парсинг и манипуляции с данными
     time.sleep(30)

It is necessary that either when you click a button on the site, or when you start the server with this project, this function runs in the background. If you execute this function through a function that is called by a get request, then the server will stop its work and will execute this cycle. There are no ideas on how to make it start executing itself when the server starts up. How to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bituke, 2021-03-09
@bituke

I solved the issue with: https://crazyzubr.ru/programming/python/django-bac...

S
SashaN69, 2021-03-09
@SashaN69

There was a question

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question