I really like data visualisation and I’m flashed by Dash a lot. The callback functions / “crossfilter” is really the killer feature for me. I used dc.js / crossfilter before … but now in python, with pandas. Great.
Just wanted to announce that I integrated Dash in the PythonOnWheels web framework.
You may say: oh know, not yet another framework.
But the idea is to make you focus on the data, logic and visualisation and not so much the framework. It shall take away the boring, boilerplate and app infrastructure stuff. Rails workflow.
I made a short online demo integrating dash in a bootstrap4 view, served from a NoSQL DB (tinyDB, which is also great by the way The demo is the callback example from the dash user guide. (Gapminder… also great)
Oh, and not to forget. The implementation is based on the great idea of Ead from this dash community forum.(Wish I had more hands to give you more thumbs up!)
Hi Klaas, thanks for sharing this. I want to use POW for a work project but I never can get the demo server.py to run. I verified I created the dashtest directory, virtual environment, $PYTHONPATH, and pip install -r requirements.txt correctly. What am I doing wrong?
(dashtest) ~/D/dashtest ❯❯❯ python server.py
Traceback (most recent call last):
File “server.py”, line 16, in
from dashtest.application import Application, log_handler
File “application.py”, line 12, in
from dashtest.database.sqldblib import Base, Session, engine
File “database/sqldblib.py”, line 67, in
from dashtest.models.sql.sqlmodel import SqlModel
File “models/sql/sqlmodel.py”, line 1, in
from dashtest.models.sql.basemodel import SqlBaseModel
File “models/sql/basemodel.py”, line 18, in
from testapp.config import database as dbcfg
ModuleNotFoundError: No module named ‘testapp’
this is not your fault. This is a bug in POW 9.10 refering to a non existing module.
Please update pythononwheels to 0.911
pip install -U pythononwheels
I tested the dash setup with this today and it worked fine.
It’s probably best to delete the dashapp dir and generate a new one with 0.911
just as you did before.
Sorry for the inconveniance and many thanks for pointing it out !
Thanks, Klaas. The server and the dash demo now run perfectly! However, I get a 500 error if I attempt to access localhost:8080/dash after updating the dash packages to their current versions. Reverting to the old versions you specify in dash_requirements.txt restores the app again. Please try pip install -U dash, restart the server, and let me know if you have the same results.
Status: 500 Message: (<class 'NameError'>, NameError("name 'http_code' is not defined"), <traceback object at 0x112e3fd20>) URI: /dash
I will integrate the update in the next two days to a new PythonOnWheels release.
Will upload a working pre-release Version tonight (0.911b1). So you and anyone else can play around with PoW and the up-to-date Dash versions.
Just update with
pip install -U pythononwheels
Need to add some tests and fine tuning for a 0.912
Wonderful news, Klaas! So glad to hear you are updating POW to work with the latest versions of dash. I am one of those trouble-makers who updates packages and breaks everything lol. (p.s. should I avoid updating tornado?)
wasn’t there a famous commercial saying the “troublemakers” are the ones that actually change the world ??
But seriously … updating tornado as well is a good idea. Updates in Tornado include a lot of improvements in asyncIO and type annotations. Really worth it. I tried it and it only needed some tiny fixes to get it working with
tornado==6.0.3
I will now try to make a package including the dash and tornado updates. I think that will really improve the PoW options a lot.
May take another day or two since I also tackle some other areas like updating the 404 and error template, which I saw a lot in the last days
Verified! The demo server and dash app both loaded perfectly, Klaas. Thank you for all you have done. I’ll install this new version in our dev repo tomorrow and start migrating our current dashboards over.
Because I can’t stop myself, I updated all other outdated packages to their current versions with no negative repercussions (yet). If I messed up anything, I can always revert to the versions in your requirements file.
Hey, Philip, great to hear. Being up-to-dat with the modules is really great for PoW. If anything else pops up just create an issue or post here for Dash relatd things.