Streamlit commited on
Commit ·
ff7ad72
1
Parent(s): e5f098a
App.py
Browse files
README.md
CHANGED
|
@@ -1,13 +1,7 @@
|
|
| 1 |
---
|
| 2 |
title: Login
|
| 3 |
-
emoji: 🐨
|
| 4 |
-
colorFrom: indigo
|
| 5 |
-
colorTo: gray
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.49.1
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
-
|
| 10 |
-
short_description: test login
|
| 11 |
-
---
|
| 12 |
-
|
| 13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
title: Login
|
|
|
|
|
|
|
|
|
|
| 3 |
sdk: gradio
|
| 4 |
sdk_version: 5.49.1
|
| 5 |
+
python_version: 3.13
|
| 6 |
app_file: app.py
|
| 7 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def login(username, password):
|
| 4 |
+
return (username=="admin" and password=="password")
|
| 5 |
+
|
| 6 |
+
def update_message(request: gr.Request):
|
| 7 |
+
return f"Welcome, {request.username}!"
|
| 8 |
+
|
| 9 |
+
with gr.Blocks(title="Login Test") as demo:
|
| 10 |
+
message = gr.Markdown()
|
| 11 |
+
demo.load(update_message, None, message)
|
| 12 |
+
|
| 13 |
+
demo.launch(auth=login, ssr_mode=False)
|