Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyxley in production #44

Open
jonbma opened this issue Sep 11, 2016 · 1 comment
Open

pyxley in production #44

jonbma opened this issue Sep 11, 2016 · 1 comment

Comments

@jonbma
Copy link

jonbma commented Sep 11, 2016

First of all, a huge fan of Pyxley and how easy it is to get up and running.

I'm curious when the pyxley in production portion of the tutorial/doc will be written? https://media.readthedocs.org/pdf/pyxley/latest/pyxley.pdf

I know there's a template #27 and it's not yet documented.

Any guidance would be appreciated!

@nmkridler
Copy link
Contributor

Thanks! Sorry for the late reply. I plan on getting to it at some point in the near future, but I haven't had time just yet.

I have a few apps running in production and the only real difference is that I override the default route function behavior. For example, I have one app that uses a postgres backend. Instead of the default behavior that filters a dataframe that's held in memory, I query the sql database.

Imagine you have some object that lets you query the sql database. Then you could use a function like below to be the new route function. So if you had a Pie Chart in your app, instead of filtering a dataframe in the default function, it would call this other function.

    def get_pie_data(self, name, args):
        df = _sql.query("sometable", filters=args)
        return PieChart.to_json(df, self.values[name])

When I get some time, I'm going to try to come up with something a little more thorough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants