11 New User Notifications
Select a tab above to activate This blank page message helps protect your privacy, or you can show the first message here automatically through settings page
- Melissa Ayre INBOX Re: New security codes Hello again and thanks for being part... 56 seconds ago
- Adison Lee Msed quia non numquam eius 2 minutes ago
- Oliver Kopyuv Msed quia non numquam eius 3 days ago
- Dr. John Cook PhD Msed quia non numquam eius 2 weeks ago
- Sarah McBrook Msed quia non numquam eius 3 weeks ago
- Anothony Bezyeth Msed quia non numquam eius one month ago
- Lisa Hatchensen Msed quia non numquam eius one year ago
-
Administrator UPDATE System updated to version 4.5.1 (patch notes) 5 mins ago
-
Adison Lee replied to your video Cancer Drug Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day... 10 minutes ago
[your date here]
|
||||||
---|---|---|---|---|---|---|
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 1 | 2 | 3 |
2:30PM - Doctor's appointment
3:30PM - Report overview
4:30PM - Meeting with Donnah V.
5:30PM - Late Lunch
6:30PM - Report Compression
Live Data Access Posting requests and handling data responses into live charts
Live Chart Updates with Asynchronous Data Updates
The charts page in the sadjdemo application shows how to link up a Django server via Ajax calls.
There are two examples. The first refreshes all the data into the chart with each call. The browser calls the Django server repeatedly, and receives back asynchronous data messages, each of which contains the full data-set for the chart. The second example adds to the existing data in the chart after each call, deleting older data points to keep a constant duration of displayed data.
sadjcore
functionality Using a Django form is the most reliable and straightforward method of posting data back to the server, in particular as it handles the CSRF token with a simple template-include. The sadjdemo frame contains a hidden form for this purpose, which can be used with a simple call to a generic method in the sadjcore javascript. There are more details about this on the ajax documentation page
In this case, the script on the page contains the following line:
sadj$.utils.ajaxPOST("api/chartData/", JSON.stringify(payload), "sadj_charts", demoLineUpdate)
The sadjdemo
Django app then contains the url definition:
path("api/chartData/", demo_views.chart_data)
alongside the code at demo_views.chart_data
which actually returns new data in response to the call.
The Django-side code tracks the last set of values sent, so each data sample is within a reasonable range of the previous one. Note that you do not need to be logged in for this to work, Django can track per-session variables for anonymous users using the session ID based on session cookies.