uWSGI无法正常运行的简单Bottle应用程序(返回404)

用户名

我有一个使用Bottle构建的简单的hello-world应用程序:

from bottle import route, run
import bottle

app = bottle.Bottle()

@route('/hello')
def hello():
        return "hello world"

if __name__ == '__main__':
    run(port=8080, debug=True)
else:
        application = app

当由运行时,它适用于127.0.0.1:8080 python bottle-hello.py但是,当我尝试使用uWSGI运行它时:

uwsgi --http :8000 --wsgi-file bottle-hello.py

访问127.0.0.1:8000会显示404未找到错误。

这是uWSGI输出的日志信息。最后一行显示它接收到请求,但不返回任何内容...

*** Starting uWSGI 2.0.4 (64bit) on [Tue May 27 15:12:52 2014] ***
compiled with version: 4.8.2 on 27 May 2014 14:05:00
os: Linux-3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014
nodename: ubuntu
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /apps/bottle-hello
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 7726
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
spawned uWSGI http 1 (pid: 8694)
uwsgi socket 0 bound to TCP address 127.0.0.1:48544 (port auto-assigned) fd 3
Python version: 2.7.6 (default, Mar 22 2014, 23:03:41)  [GCC 4.8.2]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x25bb130
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72752 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x25bb130 pid: 8693 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 8693, cores: 1)
[pid: 8693|app: 0|req: 1/1] 127.0.0.1 () {36 vars in 632 bytes} [Tue May 27 15:13:01 2014] GET /hello => generated 730 bytes in 20 msecs (HTTP/1.1 404) 2 headers in 87 bytes (1 switches on core 0)
扬·维尔辛斯基

这里是更正的代码:

import bottle

app = application = bottle.Bottle()

@app.route('/hello')
def hello():
    return "hello world"

if __name__ == '__main__':
    app.run(port=8080, debug=True)

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

uWSGI的简单Bottle应用程序不起作用(返回404)

来自分类Dev

我无法在Debian上使用uwsgi正确设置Bottle的应用程序

来自分类Dev

Apache Spark流简单应用程序无法正常工作

来自分类Dev

简单的互斥锁应用程序无法正常工作?

来自分类Dev

Nodeclipse:即使最简单的应用程序也无法运行

来自分类Dev

无法与JRE 10运行简单的Java应用程序

来自分类Dev

无法在Android中运行简单的Hello World应用程序

来自分类Dev

从android studio运行应用程序无法正常工作

来自分类Dev

设置应用程序图标无法正常运行(WinForm)

来自分类Dev

无法正常运行Struts 2应用程序的可能问题

来自分类Dev

使用 Rack 运行 React 应用程序无法正常工作

来自分类Dev

使用Nginx运行守护程序的Bottle应用程序

来自分类Dev

Flask应用程序在使用线程池(使用UWSGI)时无法正常工作

来自分类Dev

尝试通过uwsg运行flask应用程序时无法从uwsgi加载配置

来自分类Dev

无法运行应用程序

来自分类Dev

我的简单Dash应用程序应用程序有什么问题,导致我的绘图无法正常工作?

来自分类Dev

Socket.io简单节点应用程序无法正常工作

来自分类Dev

为了使我能够从VS 2019在Azure上运行一个简单的Bottle Web应用程序,应将资源组和运行时堆栈设置为什么?

来自分类Dev

angularjs的应用程序无法正常工作

来自分类Dev

显示应用程序无法正常工作

来自分类Dev

C 应用程序无法正常工作

来自分类Dev

Heroku 应用程序无法正常工作

来自分类Dev

无法运行简单的 node.js 应用程序抛出错误:听 EACCES

来自分类Dev

slackclient应用程序在PyInstaller构建后无法正常运行,但可以在python cmdline中正常运行

来自分类Dev

在Tomcat上本地运行AngularJS编码的基本应用程序无法正常工作

来自分类Dev

Flask应用程序记录器在Gunicorn中运行时无法正常工作

来自分类Dev

在Service Fabric应用程序中运行时,WebJob SDK无法正常工作

来自分类Dev

scalesPageToFit无法在iPad(iOS 7)上正常运行iPhone应用程序

来自分类Dev

托管应用程序后,npm运行生产无法正常工作

Related 相关文章

  1. 1

    uWSGI的简单Bottle应用程序不起作用(返回404)

  2. 2

    我无法在Debian上使用uwsgi正确设置Bottle的应用程序

  3. 3

    Apache Spark流简单应用程序无法正常工作

  4. 4

    简单的互斥锁应用程序无法正常工作?

  5. 5

    Nodeclipse:即使最简单的应用程序也无法运行

  6. 6

    无法与JRE 10运行简单的Java应用程序

  7. 7

    无法在Android中运行简单的Hello World应用程序

  8. 8

    从android studio运行应用程序无法正常工作

  9. 9

    设置应用程序图标无法正常运行(WinForm)

  10. 10

    无法正常运行Struts 2应用程序的可能问题

  11. 11

    使用 Rack 运行 React 应用程序无法正常工作

  12. 12

    使用Nginx运行守护程序的Bottle应用程序

  13. 13

    Flask应用程序在使用线程池(使用UWSGI)时无法正常工作

  14. 14

    尝试通过uwsg运行flask应用程序时无法从uwsgi加载配置

  15. 15

    无法运行应用程序

  16. 16

    我的简单Dash应用程序应用程序有什么问题,导致我的绘图无法正常工作?

  17. 17

    Socket.io简单节点应用程序无法正常工作

  18. 18

    为了使我能够从VS 2019在Azure上运行一个简单的Bottle Web应用程序,应将资源组和运行时堆栈设置为什么?

  19. 19

    angularjs的应用程序无法正常工作

  20. 20

    显示应用程序无法正常工作

  21. 21

    C 应用程序无法正常工作

  22. 22

    Heroku 应用程序无法正常工作

  23. 23

    无法运行简单的 node.js 应用程序抛出错误:听 EACCES

  24. 24

    slackclient应用程序在PyInstaller构建后无法正常运行,但可以在python cmdline中正常运行

  25. 25

    在Tomcat上本地运行AngularJS编码的基本应用程序无法正常工作

  26. 26

    Flask应用程序记录器在Gunicorn中运行时无法正常工作

  27. 27

    在Service Fabric应用程序中运行时,WebJob SDK无法正常工作

  28. 28

    scalesPageToFit无法在iPad(iOS 7)上正常运行iPhone应用程序

  29. 29

    托管应用程序后,npm运行生产无法正常工作

热门标签

归档