You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To answer a question on Taipy discord, I created a little login example using Taipy:
fromtaipy.guiimportGui, notifylogin_open=Trueusername=''password=''dialog_md="""<|{login_open}|dialog|title=Login|labels=Create account|on_action=create_account|width=30%|**Username**<|{username}|input|label=Username|class_name=fullwidth|>**Password**<|{password}|input|password|label=Password|class_name=fullwidth|><br/><|Sign in|button|class_name=fullwidth plain|on_action=login|>|>"""defcreate_account(state):
notify(state, "info", "Creating account...")
# Put your own logic to create an account# Maybe, by opening another dialogstate.username="Taipy"state.password="password"notify(state, "success", "Account created!")
deflogin(state):
# Put your own authentication system hereifstate.username=="Taipy"andstate.password=="password":
state.login_open=Falsenotify(state, "success", "Logged in!")
else:
notify(state, "error", "Wrong username or password!")
pages= {"/": dialog_md,
"Home": "# Taipy application"}
if__name__=="__main__":
Gui(pages=pages).run()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
To answer a question on Taipy discord, I created a little login example using Taipy:
Beta Was this translation helpful? Give feedback.
All reactions