Skip to content

Commit

Permalink
Merge pull request #257 from AKSW/feature/fixUwsgi
Browse files Browse the repository at this point in the history
Fix execution with uwsgi and docker
  • Loading branch information
white-gecko authored Feb 1, 2020
2 parents 9888052 + 9494fcb commit b4c4bb4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ All notable changes to this project should be documented in this file. But actua
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project from now on adheres to [Semantic Versioning](http://semver.org/).

## [0.24.3] - ???

## [0.24.4] - ???
### Added
-

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

## [0.24.3] - 2019-12-22 (iiii)
### Fixed
- execution with uwsgi and docker

## [0.24.2] - 2019-12-17
### Fixed
- pyinstaller dependency to `_cffi_backend`
Expand Down
37 changes: 16 additions & 21 deletions quit/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,30 @@

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

sys.setrecursionlimit(2 ** 15)

def main():
sys.setrecursionlimit(2 ** 15)
defaults = getDefaults()
env = parseEnv()
args = parseArgs(sys.argv[1:])
args = {**defaults, **env, **args}
application = create_app(args)

defaults = getDefaults()
env = parseEnv()
args = parseArgs(sys.argv[1:])
args = {**defaults, **env, **args}
application = create_app(args)
# Set the basepath
if args['basepath']:
logger.info("Configure DispatcherMiddleware for basepath \"{}\"".format(args['basepath']))

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

See also: http://werkzeug.pocoo.org/docs/0.14/middlewares/
"""
resp('200 OK', [('Content-Type', 'text/plain')])

application.wsgi_app = DispatcherMiddleware(
application.wsgi_app = DispatcherMiddleware(
simple, {args['basepath']: application.wsgi_app})

if __name__ == "__main__":
application.run(debug=args['flask_debug'],
use_reloader=False,
host=args['host'],
port=args['port'])


if __name__ == "__main__":
main()

0 comments on commit b4c4bb4

Please sign in to comment.