Defer Streamlit setup to runtime; lazy-import main in app.py
Browse files- app.py +2 -3
- human_design_app.py +12 -10
app.py
CHANGED
|
@@ -9,8 +9,7 @@ import os
|
|
| 9 |
# Add the current directory to Python path
|
| 10 |
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
| 11 |
|
| 12 |
-
# Import and run the main application
|
| 13 |
-
from human_design_app import main
|
| 14 |
-
|
| 15 |
if __name__ == "__main__":
|
|
|
|
|
|
|
| 16 |
main()
|
|
|
|
| 9 |
# Add the current directory to Python path
|
| 10 |
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
if __name__ == "__main__":
|
| 13 |
+
# Import lazily to avoid import-time Streamlit initialization issues
|
| 14 |
+
from human_design_app import main
|
| 15 |
main()
|
human_design_app.py
CHANGED
|
@@ -13,16 +13,18 @@ import base64
|
|
| 13 |
from typing import Dict, List, Tuple, Optional
|
| 14 |
import math
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
# Custom CSS for better styling
|
| 25 |
-
st.markdown("""
|
| 26 |
<style>
|
| 27 |
.main-header {
|
| 28 |
font-size: 3rem;
|
|
@@ -342,7 +344,7 @@ def create_pdf_report(name: str, email: str, birth_date: date, birth_time: str,
|
|
| 342 |
|
| 343 |
def main():
|
| 344 |
"""Main Streamlit application"""
|
| 345 |
-
|
| 346 |
st.markdown('<h1 class="main-header">π Human Design Chart Generator</h1>', unsafe_allow_html=True)
|
| 347 |
|
| 348 |
st.markdown("""
|
|
|
|
| 13 |
from typing import Dict, List, Tuple, Optional
|
| 14 |
import math
|
| 15 |
|
| 16 |
+
def _setup_page():
|
| 17 |
+
"""Configure Streamlit page and inject styles. Call inside main()."""
|
| 18 |
+
# Set page config
|
| 19 |
+
st.set_page_config(
|
| 20 |
+
page_title="Human Design Chart Generator",
|
| 21 |
+
page_icon="π",
|
| 22 |
+
layout="wide",
|
| 23 |
+
initial_sidebar_state="expanded"
|
| 24 |
+
)
|
| 25 |
|
| 26 |
+
# Custom CSS for better styling
|
| 27 |
+
st.markdown("""
|
| 28 |
<style>
|
| 29 |
.main-header {
|
| 30 |
font-size: 3rem;
|
|
|
|
| 344 |
|
| 345 |
def main():
|
| 346 |
"""Main Streamlit application"""
|
| 347 |
+
_setup_page()
|
| 348 |
st.markdown('<h1 class="main-header">π Human Design Chart Generator</h1>', unsafe_allow_html=True)
|
| 349 |
|
| 350 |
st.markdown("""
|