Skip to content

Commit

Permalink
Move Gunicorn debugger into middleware function
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjj committed Oct 30, 2022
1 parent fe019ec commit dbe0b71
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions snakeeyes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def create_app(settings_override=None):
app.register_blueprint(contact)
extensions(app)

if app.debug:
app.wsgi_app = DebuggedApplication(app.wsgi_app, evalex=True)

return app


Expand All @@ -71,4 +68,18 @@ def extensions(app):
return None


def middleware(app):
"""
Register 0 or more middleware (mutates the app passed in).
:param app: Flask application instance
:return: None
"""
# Enable the Flask interactive debugger in the brower for development.
if app.debug:
app.wsgi_app = DebuggedApplication(app.wsgi_app, evalex=True)

return None


celery_app = create_celery_app()

0 comments on commit dbe0b71

Please sign in to comment.