python - uwsgi的应用词典中mountpoint是什么意思?
问题描述
我写了一个名为 hello.py 的 python 文件
import uwsgi
def firstapp(env, start_response):
start_response('200 OK', [('Content-TYpe', 'text/html')])
yield "hello application \n"
def secondapp(environ, start_response):
start_response('200 OK', [('Content-TYpe', 'text/html')])
yield "second application \n"
uwsgi.applications = {
'': firstapp,
'/first': firstapp,
'/second': secondapp,
}
然后从命令行执行命令:
uwsgi --http :9090 --wsgi hello
日志有以下内容:
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xf10400 pid: 31023 (default app)
WSGI app 1 (mountpoint='/second') ready in 0 seconds on interpreter 0xf10400 pid: 31023
WSGI app 2 (mountpoint='/first') ready in 0 seconds on interpreter 0xf10400 pid: 31023
我认为这是成功的。
我使用 curl 分别请求“http://127.0.0.1:9090/first”和“http://127.0.0.1:9090/second”。但是响应总是“hello application”,没有“second application”。
我认为 mountpoint 意味着不同的路径,但它看起来不像,那么 mountpoint 是什么?
参考文档:https ://uwsgi-docs.readthedocs.io/en/latest/Python.html#application-dictionary
解决方案
推荐阅读
- php - 如何检查多个数字是否在逗号分隔的字符串中?
- python - 如何使用查询参数过滤 DRF 中的对象?
- python-3.x - 首次将 Python 与 Google 表格一起使用以在 GitHub 和 Jira 中查询 API 的最佳方法?
- python - 如何解决 Django 中的 NOT NULL 约束失败错误
- python-3.x - 如何将整数转换为罗马数字?
- c# - 我无法在 c#asp.net MVC 中将 StringBuilder 转换为字符串
- javascript - 从 JavaScript 连接到普通套接字
- python - 在多个 ec2 实例上运行相同的 github python 代码的最佳实践是什么?
- php - Laravel 中的 Composer 更新错误“需求无法解析为可安装的软件包集”
- java - 如何在android的片段中设置后退按钮的导航