-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_app.py
More file actions
60 lines (44 loc) · 1.61 KB
/
Copy pathrun_app.py
File metadata and controls
60 lines (44 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""
Run the PyPath Shiny Dashboard.
This script provides a programmatic way to start the PyPath Shiny app.
For CLI-based startup, you can also use: shiny run app/app.py
Usage:
python run_app.py
Or with custom port:
python run_app.py --port 8080
Development with auto-reload (DO NOT use in production):
python run_app.py --reload
Installation:
pip install -e ".[web]" # Install web dashboard dependencies
"""
import argparse
import sys
from pathlib import Path
# Add src to path for pypath imports
sys.path.insert(0, str(Path(__file__).parent / "src"))
def main():
parser = argparse.ArgumentParser(description="Run PyPath Dashboard")
parser.add_argument("--host", default="127.0.0.1", help="Host address")
parser.add_argument("--port", type=int, default=8000, help="Port number")
parser.add_argument(
"--reload",
action="store_true",
help="Enable auto-reload (development only, not for production)",
)
args = parser.parse_args()
# Warn if reload is enabled
if args.reload:
print("\n⚠️ WARNING: Auto-reload is enabled. This is for DEVELOPMENT ONLY.")
print(" Do not use --reload in production environments.\n")
# Import and run the app
from app.app import app
print(f"\n{'=' * 50}")
print(" PyPath Dashboard")
print(f"{'=' * 50}")
print(f"\n Starting server at http://{args.host}:{args.port}")
if args.reload:
print(" Mode: Development (auto-reload enabled)")
print(" Press Ctrl+C to stop\n")
app.run(host=args.host, port=args.port, reload=args.reload)
if __name__ == "__main__":
main()