pyxley icon indicating copy to clipboard operation
pyxley copied to clipboard

How to generate views dynamically with DB or dynamic sources without overwritting views functions

Open enanablancaynumeros opened this issue 10 years ago • 1 comments

Hi,

I just started using pyxley to create some dashboards and we are currently facing a little issue:

This pyxley dashboards are part of a bigger flask application and lies on a blueprint, that part is fine after some minor problems. The big problem comes when we want to render the same dashboard with the data updates, because that means we need to restart the application every time this happens, otherwise we will be overwriting the same flask endpoint for the react components.

Somebody have any thoughts on that particular problem? We can create infinite endpoints with increasing numbers, but obviously that is not the right approach :)

Thanks, Yeray

enanablancaynumeros avatar Feb 04 '16 17:02 enanablancaynumeros

Hi Yeray,

I've started work on a template for how I'm using the pyxley in production. pyxley-template It's not documented yet, but maybe it can help.

Currently, we update our dashboards daily. I have a scheduler that looks for new data based on the date and then pulls the data into a cache layer. In the template, I set up custom routing functions that get passed to the pyxley components. This way the data is decoupled form the pyxley component. Instead of the caching layer, you could have the route function call a database.

In the template, I've also added a build step where I make all the javascript first and then when the app runs, it does all the flask plumbing.

Edit: I put the markdown link in wrong, it's fixed now

nmkridler avatar Feb 04 '16 17:02 nmkridler