Answer the question
In order to leave comments, you need to log in
How to load elements in Django?
Hello.
How to make elements load dynamically in Django? For example, I have code in my view that sorts out a lot of information from the database. As a result, the page takes a long time to load. I tried to solve the problem with the @cache_page() decorator, but then I realized that it was inefficient.
How to execute my code separately from page loading? So that the page loads quickly, and the code loads later.
Example: For example, I have several CS:GO servers, from each of the servers it is necessary to collect information about how many players are currently playing. But these queries take a long time to complete. In the HTML page itself, it looks like this (a circle that will fill up with the appearance of people on the server):
It needs to be displayed over time, because. it takes a long time to load.
Answer the question
In order to leave comments, you need to log in
www.celeryproject.org
cron is ok if the tasks are periodic and do not depend on the user
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question