Coder Social home page Coder Social logo

Comments (2)

delsim avatar delsim commented on June 9, 2024

@GarderesG this is not an uncommon issue - in general passing the name (or some other label/tag) of the data to the Dash app through the template, and then using standard Django functionality to access the data inside the callback, is a common use case IMHO.

This means that the real question is what is the best way of making that data available. This depends a lot on your application but in general putting something into a cache using other Django views (eg the one with the template in is usually good; refreshing the app page then repopulates the cache) or mechanism (eg a timer with celery) seems to work well.

You probably don't want to do too much work during a callback, but at the same time if the data is relatively cheap you could have the 'get from cache or repopulate it' logic inside the callback if external population is a step too far.

from django-plotly-dash.

GarderesG avatar GarderesG commented on June 9, 2024

Thank you for your reply @delsim.
Could you point me in the right direction to implement the 'get from cache or repopulate it' logic? I do not have a huge experience with Django, and I have had trouble finding relevant information about it. Would love to get more details :)

from django-plotly-dash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.