-
2 votesanswersviews
如何在python烧瓶(restplus)中的GET请求中传递URL作为参数?
我正在使用python flask创建一个REST API . API已准备就绪,可以在我的localhost的端口号8000上运行 . 现在我打算给这个REST API一个用户友好的界面,我决定使用python - restplus . 我想在内部从5000上运行的swagger应用程序调用此服务(在8000上运行) 我能够创建API的基本结构(Swagger) . 代码如下所示: imp... -
0 votesanswersviews
使用Flask-restplus初始化SQLAlchemy实例的位置
我有两个模块相互导入的困境 . 在这个Flask-restplus应用程序中,app.py是Flask app和SQLAlchemy db实例初始化的入口点 . import settings from apis.rest import api from apis.audio_namespace import ns as audio_namespace log = logging.getLogg... -
0 votesanswersviews
无法使用uWSGI运行Restplus Flask API
我现在正试图用uWSGI替换Flask开发服务器,但一切都中断了 . 我找不到问题的解决方案了 . 这是代码: app.py import logging.config import settings import utils from flask import Flask, Blueprint from flask_restplus import Resource, Api from flas... -
1 votesanswersviews
如果使用Marshmallow,SQLAlchemy不会创建表
我正在尝试使用 Flask , Flask-SQLAlchemy , flask-restplus 和 marshmallow (也尝试使用 flask-marshmallow )创建项目,但这些工具的集成效果不佳 . 每次我包含一些新的lib时,都会出现新的错误 . 我已经放弃使用 migrations 与 Flask-SQLAlchemy 因为某些原因,这件事不起作用 . 但现在,问题在于 m... -
1 votesanswersviews
Swagger Nginx flask-restplus
我正在尝试使用Nginx作为代理从Flask-RESTplus获取Swagger UI . Swagger服务于/ api并使用http://localhost:5000/api在本地工作 . 我正在尝试将Nginx设置为代理,因此我可以转到http://ServerIP/api并查看Swagger UI . 我已经为Nginx尝试过很多配置,目前已经有了 location /api { ... -
0 votesanswersviews
测试路由蓝图 - Flask Restplus
我正试图在Flask-Restplus网站上测试ToDo的例子,但它一直让我得到404 ...... 基本上我有3个文件: app.py import sys import os import platform import datetime import logging from logging import Formatter from logging.handlers import ... -
0 votesanswersviews
如何在IIS中使用Flask RestPlus?
我试图使用Flask RestPlus与IIS,但有问题,因为没有生成Swagger.json . 事实上,甚至无法控制Swagger UI,因为它为静态资产采用绝对基本服务器根URL . 能够至少访问URL:http://localhost/flask-demo/todo/api/v1.0/endpoint1/doc/,当我点击它时,我得到的消息为 Can't read swagger JSON... -
2 votesanswersviews
如何通过API(最好使用flask-restplus)封送腌制物品?
我有一个完整记录和完成的API,使用flask-restplus在python 3.5 / flask中构建 . 我想添加一个功能块 - 返回一个pickle对象作为我的一个响应的一部分 . 欢迎使用不特定于flask-restplus的一般解决方案,但由于我的API已完全记录并完成(除了这一点),我宁愿挂起而不是从根本上改变我正在使用的框架 . 我的模型架构看起来像这样(简化): get_fie... -
1 votesanswersviews
如何在Flask Restplus文档中指明基本URL
您能否描述一下如何在Flask Restplus自动生成的文档中指明基本URL? 我正在运行以下代码,但没有显示在swagger UI中: from flask import Flask from flask_restplus import Api app = Flask(__name__) api = Api(app, title='Data Quality Framework API... -
0 votesanswersviews
是否可以使用flask-RESTplus自动生成swagger元数据json?
我使用python库flask-Restplus创建了一个api,并将它的关联swagger ui暴露给例如http://serverURL:80/api/v1/documentation . 有可能以某种方式将此文档页面公开为json吗?我知道这可以使用.Net库"Swashbuckle"(例如http://serverURL:80/api/v1/documentation.... -
2 votesanswersviews
使用Flask-RESTPlus验证自定义字段
我正在尝试创建一个自定义字段,用于使用Flask-RESTPlus 0.10.1在我的API中验证POSTed JSON 以下是基本设置...... from flask_restplus import fields import re EMAIL_REGEX = re.compile(r'\S+@\S+\.\S+') class Email(fields.String): __sch... -
2 votesanswersviews
如何在Flask-restplus API中从API更改为域名?
我试图将我的烧瓶api转发到 mydomain.example ,终点是 api.mydomain.example 例如,我的方法 ping 将有一个终点 api.mydomain.example/v1/server/ping . 但是,我得到的是 xx.xxx.xxx.xx:5005/v1/server/ping 作为 endpoints . 在SO中查看其他问题我找到了修改 app.con... -
2 votesanswersviews
如何在flask-restplus中将autah放在文档 endpoints 的swagger UI中?
我喜欢flask restplus和swagger UI,我唯一无法弄清楚的是如何在文档 endpoints 的调用周围放置一个自定义auth装饰器,以防止其他人看到文档 . 我认为可能是文档中的这一部分 如果您需要自定义UI,可以使用documentation()装饰器注册自定义视图功能: from flask import Flask from flask_restplus import ... -
3 votesanswersviews
移动Flask-Restplus Swagger API文档
我正在尝试使用flask-restplus在python中构建一个restful API . 我希望将swagger文档放在与普通“/”不同的地方 . 我正在按照文档here并按照说明进行操作 . 我正在使用python2.7.3并具有以下代码 ~/dev/test/app.py : from flask import Flask from flask.ext.restplus import Ap... -
0 votesanswersviews
如何使用nginx uwgsi部署flask-restplus应用程序
我很难用Flask-Restplus部署Flask应用程序 . 在本地工作(wezkrug)http://localhost:5000/api时一切都很好 但是当我使用nginx uwgsi在我的应用程序中部署我的应用程序时,我在访问http://example.com/api时继续从服务器获得404响应... 看起来Flask-Restplus正在使用swaggerui用于Swagger ...... -
1 votesanswersviews
在通过Nginx代理并由gunicorn托管的Docker上运行时无法访问swagger UI
我有一个在端口5000本地运行的Flask(带Flask-restplus)应用程序 . 当我在本地启动应用程序并在URL下面时,我可以看到Swagger UI . http://localhost:5000/api/# 但是当我在NGINX,gunicorn后面跑,然后去 http://localhost:81/api/# 我得到以下错误 Can't read from server. It... -
0 votesanswersviews
在Flask-Restplus Swagger UI中停用表单输入
我正在寻找一种方法来停用 Flask-Restplus Swagger UI 中为每个 endpoints 生成的 form inputs 和 try button . 我没有在文档中找到任何信息所以我想我会问 . 你能指点我正确的方向吗?