Upload index.py
Browse files
index.py
CHANGED
@@ -6,7 +6,7 @@ import random
|
|
6 |
import os
|
7 |
|
8 |
# Load environment variables
|
9 |
-
API_URL = os.getenv("API_URL"
|
10 |
|
11 |
# Read content from text files
|
12 |
def read_content_from_file(file_path):
|
@@ -30,9 +30,9 @@ def start_registration():
|
|
30 |
st.session_state.backend_waiting = False
|
31 |
if not st.session_state.backend_waiting:
|
32 |
st.session_state.backend_waiting = True
|
33 |
-
st.warning("Waiting up to
|
34 |
try:
|
35 |
-
response = requests.post(f"{API_URL}/start_registration", timeout=
|
36 |
response.raise_for_status()
|
37 |
data = response.json()
|
38 |
print("API Response:", data)
|
@@ -132,7 +132,6 @@ def main():
|
|
132 |
|
133 |
# Tab 2: Registration Application
|
134 |
with tab2:
|
135 |
-
st.subheader("Registration")
|
136 |
registration_content = read_content_from_file("tab2.txt")
|
137 |
st.markdown(registration_content)
|
138 |
st.markdown("**Developed by [email protected]**")
|
|
|
6 |
import os
|
7 |
|
8 |
# Load environment variables
|
9 |
+
API_URL = os.getenv("API_URL")
|
10 |
|
11 |
# Read content from text files
|
12 |
def read_content_from_file(file_path):
|
|
|
30 |
st.session_state.backend_waiting = False
|
31 |
if not st.session_state.backend_waiting:
|
32 |
st.session_state.backend_waiting = True
|
33 |
+
st.warning("Waiting up to 60secs for the backend to spin up. Please wait...")
|
34 |
try:
|
35 |
+
response = requests.post(f"{API_URL}/start_registration", timeout=60) # <----------
|
36 |
response.raise_for_status()
|
37 |
data = response.json()
|
38 |
print("API Response:", data)
|
|
|
132 |
|
133 |
# Tab 2: Registration Application
|
134 |
with tab2:
|
|
|
135 |
registration_content = read_content_from_file("tab2.txt")
|
136 |
st.markdown(registration_content)
|
137 |
st.markdown("**Developed by [email protected]**")
|