问题标签 [falconframework]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
uwsgi - Falcon + uwsgi do not see changes on a Fysom state machine
I have a falcon project who makes use of a Fysom state Machine. The SM change state based on informations from the outside. The SM is created at the app launch and passed to a view as an argument. At some point I'm waiting for a user event to go in a certain state, which is sent through the API to trigger a SM event.
Problem I have is that when launched with uwsgi the view is not aware of the current state of the state, it considers it's still in its initial state, so I cannot go to the desired state.
The problem does not happen with wsgiref.simpleserver.
I there a way to make the view aware of the changes on the SM ?
Thanks
api - 将图像发布到 REST API 并使用 Falcon 库收集数据的正确方法是什么?
我尝试发布图像以通过我的 REST API 处理它。我使用 falcon 作为后端,但不知道如何发布和接收数据。
这就是我目前发送文件的方式
然而,在 Falcon repo 中,他们说 Falcon 不支持 HTML 表单发送数据,而是针对 POST 和 PUT 数据的全部范围,我不区分 POST 图像数据和上述发送的图像数据。
所以最终,我想了解什么是正确的解决方法来发送图像并通过据称由 Falcon 编写的 REST API 接收图像。你能指点一下吗?
python - SQLAlchemy 和 Falcon - 会话初始化
我想知道在哪里创建一个用于 falcon 的范围会话的最佳位置。
通过阅读 flask-sqlalchemy 代码,它以一种大致的方式执行以下操作:
这对猎鹰有用吗?get_ident
使用 gunicorn 时 func会“做正确的事”吗?
python - 在 django 中接收 PNG 文件
我有一个 falcon 服务器,我正在尝试移植到 django。其中一个 falcon 端点处理一个请求,该请求包含一个使用content_type = 'application/octet-stream'
. 它将数据写入保持正确 PNG 结构的文件。
猎鹰代码这样做:
然后像这样写png:
我无法弄清楚如何在 django 中做同样的事情。当我的视图被调用时,其中的数据request.POST[key]
已经被解码为 unicode 文本,它不再是有效的 png 数据。
我怎么能用 django 做到这一点?我应该/可以使用cgi.FieldStorage
吗?我得到的(类型)请求django.core.handlers.wsgi.WSGIRequest
没有流方法。我敢肯定有一些方法可以做到这一点,但我没有想出任何谷歌搜索。
python-2.7 - Webfaction 上的 Python Falcon
我正在尝试让 Falcon 在 Webfaction 上运行。我不完全是网络专家,所以我很难理解这些应用程序的服务方式。
我的 Webfaction 应用程序设置为mod_wsgi 4.5.3/Python 2.7
据我了解,Falcon 可以在任何 WSGI 服务器上运行。当我启动我的 mod_wsgi 服务器时,它是否会自动配置为运行 Falcon 之类的东西?还是我还需要安装 Gunicorn 之类的东西?
当我设置我的 webfaction 应用程序时,我收到了这样的目录结构:
在 index.py 文件中,我放置了在Falcon Tutorial找到的示例
我知道也有运行 WSGI 的说明,但这就是我的困惑所在 - webfaction 服务器是否已经在运行 WSGI,或者我仍然需要像 Gunicorn 这样的东西,如果是这样 - 最好的配置方式是什么?我需要一个 cron 来继续运行 Gunicorn 吗?
谢谢!
更新:
我检查了错误日志并收到关于没有名为“应用程序”的变量的 WSGI 错误,
所以我改变了:
至:
这清除了错误,但现在当我访问 mydomain.com/things 时,我收到错误 404(未找到/不存在)。
所以,这让我回到了最初的问题,即下一步是什么?似乎 url 没有被正确路由,所以它很可能与 httpd.conf 文件或类似文件有关 - 再次,这是我第一次尝试这样设置。
python - 如何在 gunicorn 中查看 python 应用程序的错误
我有使用 gunicorn 运行的falcon应用程序。如果 .py 文件中有错误,它会提供回溯,但在 grunicorn 中它只发送到控制台:
唯一的错误输出是:
如何获得完整的错误输出?我需要知道是什么导致工人无法启动。
python-3.x - AttributeError:“请求”对象没有属性“参数”
我在 python3、ubuntu 的 falcon 库中收到错误“AttributeError: 'Request' object has no attribute 'params'”。
请求 url = 127.0.0.1:8000/user?name=abc
在上面的代码中,我无法访问 req.params
python - Python Falcon 框架:可选 URI 参数
有没有办法在 Falcon web 框架中定义可选的路径参数?目前,我声明了用于修改同一资源的单独路由。
PS:对于 Flask 框架有一个类似的问题。
python-3.x - 使用 Apache2 部署 Python Falcon 应用程序
我使用 falcon 框架(v1.0)开发了一个 api。现在,我想在亚马逊 EC2 实例上使用 mod_wsgi 在 apache2 服务器上部署这个 api。
我在 EC2 服务器上使用 wsgiref 包运行我的应用程序。
当我调用https://example.com:8000/时,我没有得到任何响应,而且我的服务器也没有收到请求。
wsgi.py 文件包含:
我在 /etc/apache2/sites-available/000-default.conf 添加了以下几行
python - 使用 falcon 网络服务器在 localhost 上违反了同源策略
我正在通过 elm-reactor 运行 elm 前端localhost:8000
。它应该从通过 gunicorn on 运行的falcon 后端localhost:8010
加载 json 文件。这失败了。
前端能够加载由 elm-reactor ( :8000
) 提供的静态虚拟文件,但是当我尝试用实际后端 ( :8010
) 替换虚拟文件时,由于缺少标头而失败:
跨域请求被阻止:同源策略不允许在http://localhost:8010/api/sheets读取远程资源。(原因:缺少 CORS 标头“Access-Control-Allow-Origin”)。
来自 Firefox Inspector 的错误消息似乎相当清楚,但我不知道如何解决这个问题。我已经在 falcon 中安装了一个 CORS 中间件,但这并没有改善这种情况。
我也尝试过使用起源'localhost:8000'
,'localhost'
但都不起作用。
知道如何解决这个问题吗?