Skip to content
New issue

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

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

Already on GitHub? # to your account

flask-ipban configs #939

Open
1 task done
vks2 opened this issue Jan 3, 2025 · 1 comment
Open
1 task done

flask-ipban configs #939

vks2 opened this issue Jan 3, 2025 · 1 comment
Assignees
Labels
General Question ❓ Issue contains a general question Needs triage 🔍 Issue needs triaging

Comments

@vks2
Copy link

vks2 commented Jan 3, 2025

Question

I'm wondering if someone did a vizro integration with flask-ipban package. Is there some caveats? it impelements different routes and app hooks, so there may be some bugs with @actions...
I'll try by myself, but may be there's anyone who did it earlier. Thanks much

Code/Examples

from flask_ipban import IpBan

Which package?

None

Code of Conduct

@vks2 vks2 added General Question ❓ Issue contains a general question Needs triage 🔍 Issue needs triaging labels Jan 3, 2025
@petar-qb
Copy link
Contributor

petar-qb commented Jan 6, 2025

Hey @vks2 👋

I haven't used the flask-ipban in the Vizro app yet, but it should be possible to do something like this:

import pandas as pd
import vizro.models as vm
import vizro.plotly.express as px
from vizro import Vizro
from flask_ipban import IpBan


page = vm.Page(
    title="Charts UI",
    components=[
        vm.Graph(figure=px.scatter(px.data.iris(), x="sepal_width", y="sepal_length", color="species")),
    ],
    controls=[
        vm.Filter(column="species"),
    ]
)

dashboard = vm.Dashboard(pages=[page])

if __name__ == "__main__":
    app = Vizro().build(dashboard)

    ip_ban = IpBan(app.dash.server)
    # TODO: DO SOME STUFF WITH "ip_ban"

    app.run()

@petar-qb petar-qb self-assigned this Jan 10, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
General Question ❓ Issue contains a general question Needs triage 🔍 Issue needs triaging
Projects
None yet
Development

No branches or pull requests

2 participants