python - django-dashing not getting set up properly -


i'm trying set dashing-django first time. have been able dashboard , running i'm unable add new widget dashboard.

i have added following lines in dashing-config.js file,the file placed in static directory follows

..\dash1\dash1\static

   var mydashboard = new dashboard();     mydashboard.addwidget('custom_widget', 'number', {         getdata: function () {             var self = this;             $.get('custom_widget', function(data) {                 $.extend(self.data, data);             });         },         interval: 300     }); 

but when inspect javascript file in browser doesnt reflect of changes.

so question how add widgets , should place dashing-config.js ?

edit : 1 looking quick answer settings.py file modified suggested.

installed_apps = (     'django.contrib.admin',     'django.contrib.auth',     'django.contrib.contenttypes',     'django.contrib.sessions',     'django.contrib.messages',     'django.contrib.staticfiles',     'dash1', ---- order matters <your app>     'dashing', --- default dashing  ) 

as quick hack working: reorder installed_apps add app 'ddash' before 'dashing'.

to explain: django-dashing provides default config case don't provide one. explained in this post, order in django.contrib.staticfiles app (and collectstatic) searches files depends amongst other things on order in apps included. problem include dashing before own app, leads default config found before yours. django docs don't fail mention confusing behavior under heading of “static file namespacing”.

real solution: fortunately, dashing recognizes problem , gives option change template file , config included.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -