You are describing a 'push' of data from the server to the client (web browser)
Django is primarily designed for responding to requests, i.e. the client asks to 'pull' some data from the server.
You can do the pull via Ajax following common tutorials.
You can mimic the 'push' via Ajax by taking a 'polling' approach, where the client periodically asks the server for updates, i.e using setInterval
to repeatedly make an Ajax call.
To do true push with Django you're going to have to explore other technologies besides Ajax and Django will need some help/hacks to use them, will have to run on very specific web server platform etc.
If you are building your first webapp in Django I would recommend you avoid trying to do push updates at first and just concentrate on building the app and learning Django.
But to answer the question, options for push data are:
- HTML5 Server-sent Events
- HTTP "Long Polling"
- Web Sockets
See these questions for some further info relevant to using these in Django:
How to build a push system in django?
WebSockets vs. Server-Sent events/EventSource
Does Django have a way to open a HTTP long poll connection?
Some helpers for Django:
https://github.com/niwibe/django-sse
https://github.com/tbarbugli/django_longpolling
https://github.com/stephenmcd/django-socketio