Spaces:
Runtime error
Runtime error
Commit ·
c3e2f7d
1
Parent(s): ea6f8b3
Update app.py
Browse files
app.py
CHANGED
|
@@ -212,6 +212,10 @@ def test_Sql(sql):
|
|
| 212 |
admin = os.getenv("admin")
|
| 213 |
paswd = os.getenv("paswd")
|
| 214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
with gr.Blocks() as demo:
|
| 216 |
with gr.Tab("Query Helper"):
|
| 217 |
gr.Markdown("""<h1><center> Query Helper</center></h1>""")
|
|
@@ -228,4 +232,4 @@ with gr.Blocks() as demo:
|
|
| 228 |
clear = gr.ClearButton([text_input, text_output])
|
| 229 |
text_button.click(test_Sql, inputs=text_input, outputs=text_output)
|
| 230 |
|
| 231 |
-
demo.launch(share=True,
|
|
|
|
| 212 |
admin = os.getenv("admin")
|
| 213 |
paswd = os.getenv("paswd")
|
| 214 |
|
| 215 |
+
def same_auth(username, password):
|
| 216 |
+
if username == admin and password = paswd:
|
| 217 |
+
return 1
|
| 218 |
+
|
| 219 |
with gr.Blocks() as demo:
|
| 220 |
with gr.Tab("Query Helper"):
|
| 221 |
gr.Markdown("""<h1><center> Query Helper</center></h1>""")
|
|
|
|
| 232 |
clear = gr.ClearButton([text_input, text_output])
|
| 233 |
text_button.click(test_Sql, inputs=text_input, outputs=text_output)
|
| 234 |
|
| 235 |
+
demo.launch(share=True, same_auth)
|