[Fixed]-Django – Calculate data in advance of opening a page

1👍

I would suggest making a python script and a regular cron job to pull the data into a Django model every hour. Then you can access the Django model normally.

👤rofls

0👍

Another option would be to use Django’s inbuilt caching framework with a timeout of one hour. See
https://docs.djangoproject.com/en/1.8/topics/cache/#basic-usage

One request per hour would still result in retrieval of new data, but it would greatly speed up the display of every other request in the hour, and you wouldn’t have to deal with scheduled tasks.

👤ChidG

Leave a comment