文件组织
·/ hoge/1/a/bottle.py·/ hoge / 1 / a / hoge.py·/ hoge / 1 / a /hoge.ini
/hoge/1/a.py屏幕上显示错误显示内容
Error: 404 Not Found
Sorry, the requested URL 'http://example.com/hoge/1/a.py' caused an error:
Not found: '/hoge/1/a.py'
/hoge/1/a.py
#!/usr/bin/python3.6 python
# -*- coding:utf-8 -*-
from bottle import route, run, default_app
@route('/')
def index():
return "Hello World!"
application = default_app()
/hoge/1/a.ini
[uwsgi]
uid = nginx
gid = nginx
socket = /var/run/uwsgi/app/%n.sock
chmod-socket = 777
chdir = /var/www/example.com/hoge/1
wsgi-file = /var/www/example.com/hoge/1/%n.py
file = %n.py
processes = 4
threads = 2
a.ini日志
announcing my loyalty to the Emperor...
答案 0 :(得分:1)
这是因为只提供与已为其设置的@route
之一匹配的网址。在这种情况下,设置的唯一路线是/
,因此只有http://example.com/
才有效。