flask-restful

    2熱度

    2回答

    我正在使用Flask Restful的reqparse接口來解析請求參數。我有字段針對其所需的日期和用於我必須執行驗證 parser = reqparse.RequestParser(bundle_errors=True) parser.add_argument('date',type=date_type,required=True,help='date cannot be blank') a

    1熱度

    1回答

    我目前正在使用Flask-Restful-Swagger構建API的文檔。我的一個資源返回一個元素:一個數組。陣列中的物品的形式爲 { "active": bool, "affectation": str, "alert_type": str, ... } 等等。這些字段是bool,str,int或float。數組的每個元素總共有32個字段。我正在嘗試構建@sw

    3熱度

    1回答

    我有這樣的結構(只顯示與受影響)的一個項目: main.py # starting script /app |__init__.py |/exceptions | __init__.py # content: from .ex400 import * | base.py | ex400.py # content: some classes ext

    -1熱度

    1回答

    我有有許多API的一個名爲apis.py使用@ api.route notation.eg實施@ api.route路徑的JSON結構: @api.route('/read', methods=['GET']) @api.route('/write', methods=['POST']) 如何獲得所有這些@ api.routes路徑存儲在某個地方?可能是一個hashmap/json,

    0熱度

    1回答

    我第一次使用flask-RESTful。在docs它說: 使用reqparse模塊也給你免費的理智的錯誤消息。如果參數未能通過驗證,Flask-RESTful將以400錯誤請求和突出顯示錯誤的響應進行響應。 但是在我的情況下,我得到一個異常AssertionError。 下面的代碼: #! /usr/bin/python # -*- coding: UTF-8 -*- from flask

    2熱度

    1回答

    這裏有一個簡單的瓶的RESTful資源: class ListStuff(Resource): def get(self): stuff = SomeFunctionToFetchStuff() if re.match('/api/', request.path): return {'stuff': stuff} return make_

    0熱度

    1回答

    我嘗試使用MOD-WSGI與Apache 2.2 我有以下目錄結構: scheduling-algos -lib -common -config -config.json resources -Optimization.py optimization.wsgi optimization_app.py 我optimization_app.py如下: from flask

    0熱度

    1回答

    我有一個燒瓶API來控制浸入式加熱器設備。 https://github.com/timcknowles/anovapi_backend/blob/master/anova.py 這是我的本地服務器上,它如正確響應JQuery的POST請求在同一個域 $(document).ready(function() { $("#start").click(function() {

    2熱度

    1回答

    我下面這個例子: http://flask-limiter.readthedocs.org/en/stable/#ratelimit-string app = Flask(__name__) limiter = Limiter(app, key_func=get_remote_address) class MyView(flask.views.MethodView): decora

    0熱度

    2回答

    我正在測試Flask應用程序,並且正在接收「在應用程序上下文之外工作」錯誤。我的文件目錄如下: api app.py __init__.py models __init__.py user.py resources __init__.py deals.py stores.py common