Exemple #1
0
    def pre_run_app(self, app):
        """Wraps the application by Werkzeug's debugger.

        :param app:
            The ``WSGIApplication`` instance.
        :return:
            The application, wrapped or not.
        """
        if app.config.get('tipfy', 'dev') is False:
            # In production, don't use the debugger.
            return app

        from tipfy.ext.debugger.app import get_debugged_app
        return get_debugged_app(app)
    def post_make_app(self, app):
        """Wraps the application by Werkzeug's debugger.

        :param app:
            The WSGI application instance.
        :returns:
            The application, wrapped or not.
        """
        if app.dev is False:
            # In production, don't use the debugger.
            return app

        from tipfy.ext.debugger.app import get_debugged_app

        # Wrap the callable, so we keep a reference to the app...
        app.wsgi_app = get_debugged_app(app.wsgi_app)
        # ...and return the original app.
        return app