Skip to content

Commit

Permalink
Make the WSGI script name configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Nov 1, 2020
1 parent 85589b9 commit 332fa35
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions webware/Scripts/WaitressServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def openBrowser():
del environ['WEBWARE_DEVELOPMENT']
try:
# get application from WSGI script
with open('Scripts/WSGIScript.py') as f:
with open(args.wsgi_script) as f:
script = f.read()
# set development flag in the script
script = script.replace(
Expand All @@ -70,7 +70,7 @@ def openBrowser():

print("Waitress serving Webware application...")
args = vars(args)
for arg in 'browser reload reload_interval prod'.split():
for arg in 'browser reload reload_interval prod wsgi_script'.split():
del args[arg]
if args['trusted_proxy_headers']:
args['trusted_proxy_headers'] = args[
Expand Down Expand Up @@ -150,6 +150,11 @@ def addArguments(parser):
help="Do not set development mode",
default=False,
)
parser.add_argument(
'--wsgi-script',
help='The file path of the WSGI script',
default='Scripts/WSGIScript.py',
)


def main(args=None):
Expand Down

0 comments on commit 332fa35

Please sign in to comment.