Created
August 3, 2020 03:45
-
-
Save NanoDano/a5b10478a52bfaeaaa1ae4835f403441 to your computer and use it in GitHub Desktop.
Run a Python WSGI app with Waitress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install waitress | |
import os | |
from waitress import serve | |
from my_wsgi_project import app # Import your app | |
# Run from the same directory as this script | |
this_files_dir = os.path.dirname(os.path.abspath(__file__)) | |
os.chdir(this_files_dir) | |
# `url_prefix` is optional, but useful if you are serving app on a sub-dir | |
# behind a reverse-proxy. | |
serve(app, host='127.0.0.1', port=8001, url_prefix='/my-app') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment