-
Notifications
You must be signed in to change notification settings - Fork 323
How To: update dashboard in Django
cbrentharris edited this page Jul 15, 2014
·
2 revisions
This is an example of how to dynamically update a dashing widget from the django webframework
myproject/settings.py
...
DASHING_URL = 'http://localhost:3030/widgets' #replace with actual url
DASHING_AUTH_TOKEN = 'YOUR_AUTH_TOKEN' #replace with actual auth token
myapp/views.py
from myproject import settings
import json
import urllib2
def update_welcome(request):
#we'll assume a text widget
widget = 'some_text_widget'
widget_json = {}
widget_json['title'] = request.POST['title']
widget_json['text'] = request.POST['text']
widget_json['auth_token'] = settings.DASHING_AUTH_TOKEN
req = urllib.Request(settings.DASHING_URL + widget)
response = urllib.urlopen(req, json.dumps(widget_json))
if response:
...
- Home
- Dashing Workshop
- Installation
- Widgets
- Configuration
- Security
- Troubleshooting
- Deploying dashboards
- How Tos
- How to: post data to your dashboard and widgets
- How to: Define a data model and store history data to database
- How to: Prevent a job from overlapping with itself
- How to: Send HTML data to your widgets
- How to: Send mysql data to your widgets
- How to: Setup a Graph
- How to: Store data to and display from database
- How to: Update a Dashboard using a spreadsheet
- How to: update dashboard in Django
- How to: Update font awesome fonts from version 3 to 4
- How to: Use New Relic with Dashing
- How to: precompile assets
- Development