Skip to content

Commit 793697b

Browse files
committed
Update for use on render
1 parent 50458dc commit 793697b

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

.streamlit/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[server]
2+
headless = true
3+
enableCORS = false
4+
port = 10000 # Render will set PORT env var

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ _A Horizon Star Plot from Glasgow_
2020
2121
├── 📁 .github/workflows/ # GitHub Workflow files
2222
│ └── main.yml # CI configuration for github: Pylint and Mypy
23+
|
24+
├── 📁 .streamlit/config/ # Web app configuration files
25+
│ └── config.toml # Configuration for render to use streamlit
2326
2427
├── 📁 images/ # Image assets
2528
│ └── glasgow_horizon.png # Image generated by scripts/glasgow_horizon.py

app.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,20 @@
1919
along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
2121
"""
22-
2322
import os
2423
import pathlib
25-
import tempfile
2624
import starplot
2725
import streamlit as st
2826
from datetime import datetime, date
2927
from zoneinfo import ZoneInfo
3028
from scripts.glasgow_horizon import make_horizon_plot
3129
from scripts.glasgow_zenith import make_zenith_plot
3230

33-
# Override the library path
34-
starplot_library_dir = pathlib.Path(tempfile.gettempdir()) / "starplot_library"
35-
os.makedirs(starplot_library_dir, exist_ok=True)
36-
starplot.data.library_path = starplot_library_dir
31+
# Writable folder for Starplot / DuckDB extensions
32+
starplot_writable = pathlib.Path("starplot_library")
33+
os.makedirs(starplot_writable, exist_ok=True)
34+
# redirect internal library
35+
starplot.data.library_path = starplot_writable
3736

3837

3938
st.title("🌌 Glasgow Starplot Viewer")

0 commit comments

Comments
 (0)