<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # Flask-Exceptional Flask-Exceptional 為 [Flask](http://flask.pocoo.org/) 添加了 [Exceptional](http://www.exceptional.io/) 支持。Exceptional 會捕獲到你的應用程序中的錯誤,實時地報告它們,并且會收集你需要快速地修復它們的一些信息。訪問 [http://www.exceptional.io](http://www.exceptional.io) 去試試。 ## 安裝 接下來的文檔是假設你擁有一個 Exceptional 賬號。用 pip 安裝這個擴展是簡單的: ``` $ pip install Flask-Exceptional ``` 或者用 easy_install 安裝它: ``` $ easy_install Flask-Exceptional ``` ## 快速入門 在安裝 Flask-Exceptional 后,所有你必須要做的就是創建一個 Flask 應用程序,配置 Exceptional API 密鑰,接著創建 [`Exceptional`](#flask.ext.exceptional.Exceptional "flask.ext.exceptional.Exceptional") 對象。正是這樣的簡單: ``` from flask import Flask from flask.ext.exceptional import Exceptional app = Flask(__name__) app.config["EXCEPTIONAL_API_KEY"] = "exceptional_forty_character_unique_key" exceptional = Exceptional(app) ``` 你的應用程序是被配置成基于云的錯誤監控!你可以通過調用 [`Exceptional.test()`](#flask.ext.exceptional.Exceptional.test "flask.ext.exceptional.Exceptional.test") 方法來驗證配置是否正常工作: ``` Exceptional.test(app.config) ``` 請翻閱接下來的章節獲取更多關于 Flask-Exceptional 可用的配置項的細節。 ## 配置 Flask-Exceptional 中存在如下的配置項: | | | | --- | --- | | `EXCEPTIONAL_API_KEY` | 你的應用程序的Exceptional API 密鑰。 登錄到 Exceptional,選擇你的應用程序, 點擊 _APP SETTINGS_ 鏈接。顯示的 API 密鑰就是這里要用到的。試圖不提供 API 密鑰而創建擴展將導致 登錄警告,但應用程序將繼續正常運行。 | | `EXCEPTIONAL_DEBUG_URL` | 如果你的應用程序以調式模式運行的話, Exceptional 將不會捕獲錯誤。配置這個值 是為了在調試模式中捕獲錯誤數據。 比如,你可能使用一個 [RequestBin](http://requestb.in/) 網址 調試你的應用程序。JSON 錯誤數據會被以壓縮形式 POSTed 到這個網址, 而 Exceptional 需要解壓這些數據。 | | `EXCEPTIONAL_HTTP_CODES` | 用 Exceptional 追蹤的 HTTP 錯誤碼列表。默認為標準的 HTTP 4xx 錯誤碼。 | | `EXCEPTIONAL_PARAMETER_FILTER` | 列表值,用來過濾發給 Exceptional 的參數數據。 參數數據包括 `request.form` 和 `request.files` 中的所有。例如,為了過濾密碼你可以使用:`['password', 'password_confirm']` | | `EXCEPTIONAL_ENVIRONMENT_FILTER` | 列表值,用來過濾發給 Exceptional 的環境數據。 環境數據包含 Flask 應用程序配置以及目前 OS 環境。OS 環境值前綴是 `'os.'`。例如,為了過濾SQLAlchemy 數據庫 URL以及 所有的 OS 環境值,使用:`['SQLALCHEMY_DATABASE_URI', 'os.*']`默認值是 `['SECRET_KEY']`。 | | `EXCEPTIONAL_SESSION_FILTER` | 列表值,用來過濾發給 Exceptional 的會話數據。 | | `EXCEPTIONAL_HEADER_FILTER` | 列表值,用來過濾發給 Exceptional 的 HTTP 頭數據。 | | `EXCEPTIONAL_COOKIE_FILTER` | 名稱的列表,用來過濾發給 Exceptional 的 HTTP Cookie 頭數據。 | Note 所有配置中的過濾列表接受字符串以及正則表達式。 ## API `class flask.ext.exceptional.Exceptional(app=None)` Extension for tracking application errors with Exceptional. Errors are not tracked if DEBUG is True. The application will log a warning if no `EXCEPTIONAL_API_KEY` has been configured. Parameters: **app** – Default None. The Flask application to track errors for. If the app is not provided on creation, then it can be provided later via [`init_app()`](#flask.ext.exceptional.Exceptional.init_app "flask.ext.exceptional.Exceptional.init_app"). `static context(data=None, **kwargs)` Add extra context data to the current tracked exception. The context data is only valid for the current request. Multiple calls to this method will update any existing context with new data. Parameters: * **data** – Default `None`. A dictionary of context data. * **\*\*kwargs** – A series of keyword arguments to use as context data. `init_app(app)` Initialize this Exceptional extension. Parameters: **app** – The Flask application to track errors for. `static publish(config, traceback)` Publish the given traceback directly to Exceptional. This method is useful for tracking errors that occur outside the context of a Flask request. For example, this may be called from an asynchronous queue. Parameters: * **config** – A Flask application configuration object. Accepts either `flask.Config` or the object types allowed by `flask.Config.from_object()`. * **traceback** – A `werkzeug.debug.tbtools.Traceback` instance to publish. `static test(config)` Test the given Flask configuration. If configured correctly, an error will be tracked by Exceptional for your app. Unlike the initialized extension, this test will post data to Exceptional, regardless of the configured `DEBUG` setting. Parameters: **config** – The Flask application configuration object to test. Accepts either `flask.Config` or the object types allowed by `flask.Config.from_object()`. ## Changelog ### Version 0.5.4 * Updated JSON implementation import to work with Flask 0.10. ### Version 0.5.3 * Fixed [`Exceptional.publish()`](#flask.ext.exceptional.Exceptional.publish "flask.ext.exceptional.Exceptional.publish") to no longer dereference a request context. ### Version 0.5.2 * Unwind broken _app_ctx_stack usage. ### Version 0.5.1 * Handle malformed HTTP response status-line from Exceptional. ### Version 0.5 * Updated with Flask 0.8 extension structure recommendations and 0.9 _app_ctx_stack. * Added `{'application_environment': 'loaded_libraries': {...}}` API data. ### Version 0.4.9 * Added the [`Exceptional.context()`](#flask.ext.exceptional.Exceptional.context "flask.ext.exceptional.Exceptional.context") method to support Exceptional’s extra context data API. * Updated to reference the new exceptional.io domain. ### Version 0.4.8 * Updated to publish UTF-8 encoded data to Exceptional. * Added support for `request.json` data. ### Version 0.4.7 * Added the [`Exceptional.publish()`](#flask.ext.exceptional.Exceptional.publish "flask.ext.exceptional.Exceptional.publish") method to support Exceptional tracking outside the context of a request. ### Version 0.4.6 * Corrected `occurred_at` timestamp to be formatted as Zulu. * Fixed JSON serialization issue by coercing all environment variables to strings. ### Version 0.4.5 * Updated to log a warning on repeated extension initialization attempts. ### Version 0.4.4 * Fixed to workaround Python 2.5 issue where `urlopen()` raises a `HTTPError` even though the HTTP response code indicates success. ### Version 0.4.3 * Changed so that `app.extensions['exceptional']` targets the [`Exceptional`](#flask.ext.exceptional.Exceptional "flask.ext.exceptional.Exceptional") extension instance. ### Version 0.4.2 * Updated to support Python 2.5. ### Version 0.4.1 * Updated to support Flask 0.7 blueprints. ### Version 0.4 * Updated to support Python 2.6. * Added `EXCEPTIONAL_DEBUG_URL` testing environment variable override. ### Version 0.3 * Updated to handle unreachable Exceptional service API. ### Version 0.2 * Added [`Exceptional.test()`](#flask.ext.exceptional.Exceptional.test "flask.ext.exceptional.Exceptional.test") method. ### Version 0.1 * Initial public release.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看