How to control Django with Javascript?
You're better off using a frontend framework and calling the backend for the data via JS. separating the front and backend is a more contemporary approach and has some advantages over doing it all in the backend.
From personal experience, it gets really messy mixing Python and JS in the same system.
Use Django as a Rest-ful backend, and try not to use AJAX in the frontend, then pick a frontend of your choice to deliver the web app.
I am building a web application with Django and I show the graphs in the website. The graphs are obtained from real time websites and is updated daily. I want to know how can I send graphs using matplotlib to template and add refresh option with javascript which will perform the web scraping script which I have written. The main question is which framework should I use? AJAX, Django REST, or what?