-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpythonanywhere_wsgi.py
More file actions
33 lines (25 loc) · 925 Bytes
/
Copy pathpythonanywhere_wsgi.py
File metadata and controls
33 lines (25 loc) · 925 Bytes
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
"""
WSGI configuration for PythonAnywhere deployment.
This file exposes the WSGI callable as a module-level variable named 'application'.
For more information on this file, see:
https://help.pythonanywhere.com/pages/Flask/
"""
import os
import sys
# Import and configure the application
from dash_lite.app import create_app
# Add your project directory to the sys.path
project_home = "/home/YOUR_USERNAME/dash-lite"
if project_home not in sys.path:
sys.path.insert(0, project_home)
# Add the src directory to sys.path
src_path = os.path.join(project_home, "src")
if src_path not in sys.path:
sys.path.insert(0, src_path)
# Set environment variables
os.environ["DASH_LITE_PORT"] = "8000"
os.environ["DASH_LITE_DEBUG"] = "false"
application = create_app().server
# For debugging (remove in production)
# print(f"Python path: {sys.path}", file=sys.stderr)
# print(f"Application: {application}", file=sys.stderr)