cost 328 ms
創建 Flask 沒有命名空間的 Restx 端點

[英]Create Flask Restx endpoints without namespaces

我正在使用 Flask-restx 重新設計 API 和 Flask,但我有一個問題:出於兼容性原因,我們需要接受舊網址的 API 的舊版本,但我不明白如何這樣做是因為 flask-restx 需要聲明一個命名空間。 網址應該是這樣的: 在 Flask 我有這樣的東西: 應用程序/初始化.py / ...

如何將 url_for 與 flask_restx 一起使用?

[英]How to use url_for with flask_restx?

我可以在flask 2.0.1 模板中使用url_for<!-- flask-template.html --> <button onclick="window.location.href='{{ url_for( 'testimport') }}';" >Import&l ...

是否可以在 flask 服務器中創建多線程?

[英]Is it possible to create muti thread in a flask server?

我正在使用flask並且flask-restx嘗試創建一個協議以從另一個服務獲取特定的字符串。 我試圖找出一種在不同線程的服務器中運行 function 的方法。 這是我的代碼示例: 我期望的是: 在客戶端,首先服務器應該運行,即我們應該能夠使curl -i localhost:8080工作。 然 ...

如何在 python 中將參數從客戶端傳遞到服務器

[英]How to pass a parameter from client side to server in python

我正在使用flask並且flask-restx嘗試創建一個協議以從另一個服務獲取特定的字符串。 我想知道是否有一種方法可以將參數從另一個 function 傳遞到服務器端。 例如,這是我的服務器端: get_answer function 在不同的文件中: 我期望的是從一個文件中得到get_ans ...

Flask Restx 中的字典類型 api.model

[英]Dictionary type api.model in flask Restx

我是 flask restx 的新手並試圖創建一個 dict 類型的 api.model 但我找不到任何提到它的示例或文檔,我不確定是否有任何解決方法可以實現這一點。 請分享你的想法這是我想從 api 調用返回的數據 這是我試圖創建的 api.model 模式,但這顯然不起作用,因為只有一個鍵和值 ...

在 flask restx reqparser 中至少強制設置一個參數

[英]make at lease one argument mandatory in flask restx reqparser

我正在實現搜索端點,用戶可以在其中指定 /item?foo=f 或 /item?bar=b 來搜索項目。 我嘗試引發異常,但這只會破壞整個應用程序。 向最終用戶顯示捆綁錯誤需要引發的正確異常是什么? ...

使用 Flask RestX 啟用 Cors

[英]Enabling Cors with Flask RestX

嘗試將 CORS 添加到我的 flask 應用程序中,該應用程序使用的是使用 flask-restx 創建的 API。 希望這里有人能發現我做錯了什么。 在運行 flask 的控制台中,我沒有得到任何相關日志,並且網站說Cross-Origin Request Blocked: The Same ...

使用 Flask-JWT-Extended 和 Flask-restx

[英]Using Flask-JWT-Extended with Flask-restx

我正在使用Flask-restx構建一個 API ,我正在使用令牌系統進行身份驗證,我正在使用Flask-JWT-Extended ,在我的情況下,我設法獲得了令牌,但我無法將其放入意見,我正在使用裝飾器 @jwt_required裝飾器在這樣的視圖上class InputReaderView(R ...

flask api 的 Swagger 文檔是在 2 個不同的 url 上生成的:一個用於使用 flask_restx 的路由,另一個用於其他使用 swag_from

[英]Swagger documentation for flask api is generated on 2 different urls: one for routes using flask_restx and another - for others using swag_from

請幫忙! 我是 Swagger 和編寫燒瓶 API 的新手。 我們仍在研究最佳實踐,因此我需要使用 Blueprint 和 swag_from 創建一些路線: 雖然我有另一條使用 Blueprint 和 flask_restx 包的路線,並且其中有 get() 和 post() 方法。 結果, ...

使用 uwsgi 和 nginx 在部署中顯示 flask-restx 的 Swagger UI 時出錯

[英]Error displaying Swagger UI of flask-restx in Deployment using uwsgi and nginx

我已經使用 flask-restx 實現了一個帶有 swagger-ui 的 flask rest 服務器。 在沒有 nginx 的情況下使用命令運行服務器時,我可以讓 swagger-ui 工作 要么 我的app.ini : ==================== 但是,使用 nginx,盡管 ...

Flask-restx 請求解析器返回 400 Bad Request

[英]Flask-restx request parser returns 400 Bad Request

我在我的燒瓶應用程序中使用flask-restx但每次我使用 swagger ui 發出請求時,它都會返回 400: 我的文件結構: app/_init_.py import os from dotenv import load_dotenv from flask import Flas ...

flask-restx 如何將 model 轉換為示例

[英]flask-restx how to convert a model to an example

我使用 flask-restx 0.5.1 來定義我的 API。 描述 payload 參數時 我得到以下 當我另外使用 我可以得到以下 由於在第一張圖片中看到生成的示例非常方便和漂亮,我想知道如何同時獲得我的有效負載描述和示例? 謝謝 ...

如何在 flask restx swagger 中設置基本身份驗證的用戶名和密碼?

[英]How to set username and password for basic auth in flask restx swagger?

我正在嘗試向我的 flask rest-x 應用程序添加基本授權。 參考https://github.com/python-restx/flask-restx/issues/271我做了代碼修改。 但是這里並沒有明確說明如何設置用戶名和密碼。 同樣在 swagger 用戶界面中,我看到基本身份驗證 ...

在 Apache 上部署 Flask API,使用 mod_wsgi

[英]Deploy Flask API on Apache, with mod_wsgi

在這一點上,我已經學習了幾個教程,並且知道這一定是一些小問題。 請幫我找到它! 我有一個 Flask API,使用 Flask-Restx,准備好 go 和一個遠程 Debian VPS 和 Apache。我沒有使用虛擬環境。 我的項目位於 /var/www/ProvisioningApi/ 並包 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM