Hi there,
I am building an input form that takes in the user input and store the inputs within the class. And upon user clicking submit, I then turn the input class into a json object. This worked perfectly in local but when I deployed my app on Azure, it seems to have issues, not sure why but I think it could be due to the Input class being a global variable, and hence when user is changing the input form and clicking save, it is instead saving different values and not the intended ones.
My inputclass.py:
class InputClass:
def init(self, a: Optional[str], b: Optional[str]):
self.a = a
self.b = b
def _set_a(self, a: Optional[str]):
self.a = a
def _set_b(self, b: Optional[str]):
self.b = b
… other methods
And my page.py:
from inputclass import InputClass
input_store = InputClass(
a=“something_a”,
b=“something_b”,
)
layout = dmc.Grid(
children=[
dmc.GridCol(
children=input_form(input_object),
…
),…
]
)
@callback(
Input(“input_a”, “value”)
)
def change_a(value):
input_store._set_a(value)
and other callbacks here…
But this code seems to have issues when deployed or hosted on Azure but locally it runs perfectly fine. Is there a way to avoid this sharing of global variable? I would like such that each user has their own session and they could fill their inputs independantly. Such that each web app instance opened on browser is its separate web app independant state/session.
Any tips or suggestions would be really helpful. Thanks a lot!