-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_local.py
More file actions
19 lines (16 loc) · 835 Bytes
/
run_local.py
File metadata and controls
19 lines (16 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os
from werkzeug.serving import run_simple
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from app import app # Import the app from your app.py file
# Set an environment variable to indicate local development mode
# This will be checked in app.py to bypass limits
os.environ['APP_ENV'] = 'development'
# This middleware creates a "virtual" subdirectory for your app.
application = DispatcherMiddleware(lambda e, s: s('404 NOT FOUND', [('Content-Type', 'text/plain')]), {
'/NLSEsolver': app
})
if __name__ == '__main__':
print("Starting local development server for NLSEsolver...")
print("APP_ENV is set to:", os.environ.get('APP_ENV'))
print("Access at: http://localhost:5000/NLSEsolver/")
run_simple('localhost', 5000, application, use_reloader=True, use_debugger=True)