Dynamic Buttons/Images with Django and Mongodb -


i have mqtt client logs messages mongodb. use django dynamically create webpage image or button on depending on last insert database. example there either 0 or 1 if latest insert 0 display green power button if 1 display red power button. on pressing of button performs command , inserts opposite value in database. possible , if how?

to answer question, 1 of ways achieve want using css , jquery. use other libraries comfortable or vanilla html.

use css change color of button depending on last insert's value. use jquery's on() function handle click event , trigger ajax request django backend invoke function want.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -