Skip to content

Commit b4c4bb4

Browse files
authored
Merge pull request #257 from AKSW/feature/fixUwsgi
Fix execution with uwsgi and docker
2 parents 9888052 + 9494fcb commit b4c4bb4

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ All notable changes to this project should be documented in this file. But actua
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project from now on adheres to [Semantic Versioning](http://semver.org/).
66

7-
## [0.24.3] - ???
8-
7+
## [0.24.4] - ???
98
### Added
109
-
1110

@@ -15,6 +14,10 @@ and this project from now on adheres to [Semantic Versioning](http://semver.org/
1514
### Fixed
1615
-
1716

17+
## [0.24.3] - 2019-12-22 (iiii)
18+
### Fixed
19+
- execution with uwsgi and docker
20+
1821
## [0.24.2] - 2019-12-17
1922
### Fixed
2023
- pyinstaller dependency to `_cffi_backend`

quit/run.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,30 @@
1111

1212
logger = logging.getLogger('quit.run')
1313

14+
sys.setrecursionlimit(2 ** 15)
1415

15-
def main():
16-
sys.setrecursionlimit(2 ** 15)
16+
defaults = getDefaults()
17+
env = parseEnv()
18+
args = parseArgs(sys.argv[1:])
19+
args = {**defaults, **env, **args}
20+
application = create_app(args)
1721

18-
defaults = getDefaults()
19-
env = parseEnv()
20-
args = parseArgs(sys.argv[1:])
21-
args = {**defaults, **env, **args}
22-
application = create_app(args)
22+
# Set the basepath
23+
if args['basepath']:
24+
logger.info("Configure DispatcherMiddleware for basepath \"{}\"".format(args['basepath']))
2325

24-
# Set the basepath
25-
if args['basepath']:
26-
logger.info("Configure DispatcherMiddleware for basepath \"{}\"".format(args['basepath']))
26+
def simple(env, resp):
27+
"""A simple WSGI application.
2728
28-
def simple(env, resp):
29-
"""A simple WSGI application.
29+
See also: http://werkzeug.pocoo.org/docs/0.14/middlewares/
30+
"""
31+
resp('200 OK', [('Content-Type', 'text/plain')])
3032

31-
See also: http://werkzeug.pocoo.org/docs/0.14/middlewares/
32-
"""
33-
resp('200 OK', [('Content-Type', 'text/plain')])
34-
35-
application.wsgi_app = DispatcherMiddleware(
33+
application.wsgi_app = DispatcherMiddleware(
3634
simple, {args['basepath']: application.wsgi_app})
3735

36+
if __name__ == "__main__":
3837
application.run(debug=args['flask_debug'],
3938
use_reloader=False,
4039
host=args['host'],
4140
port=args['port'])
42-
43-
44-
if __name__ == "__main__":
45-
main()

0 commit comments

Comments
 (0)