Python 金字塔uWSGI部署且不可移植';路由器&x27;

Python 金字塔uWSGI部署且不可移植';路由器&x27;,python,pyramid,uwsgi,Python,Pyramid,Uwsgi,嘿,我在使用uWSGI部署我的应用程序时遇到问题: frontend.ini [uwsgi] http = *.*.*.*:8181 master = true #uid = uwsgiuser #gid = uwsgiuser processes = 1 harakiri = 60 harakiri-verbose = true limit-post = 65536 post-buffering = 8192 listen = 128 max-requests = 1000 rel

嘿,我在使用uWSGI部署我的应用程序时遇到问题:

frontend.ini

[uwsgi]
http = *.*.*.*:8181
master = true

#uid = uwsgiuser
#gid = uwsgiuser

processes = 1

harakiri = 60
harakiri-verbose = true
limit-post = 65536
post-buffering = 8192

listen = 128

max-requests = 1000

reload-on-as = 128
reload-on-rss = 96
no-orphans = true

log-slow = true
plugins = python
module = skysoccer.app:main
wsgi-file = /wsgi.py

pythonpath = /eggs/*.egg
pythonpath = /*
pythonpath = *
pythonpath = skysoccer/*
stats= *.*.*.*:8080
这就是我得到的:

然后当我输入webbrowser时:http://..**:8181/

在cli中,我得到:

TypeError: 'Router' object is not iterable
[pid: 13692|app: 0|req: 1/1] *.*.*.* () {36 vars in 630 bytes} [Wed Jul 10 14:36:31 2013] GET / => generated 0 bytes in 737 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)

在代码中,我没有可变的“路由器”。

我认为您不需要
模块
选项,而只需要一个
wsgi.py
文件,该文件将wsgi应用程序作为
应用程序
变量公开

为此,典型的
wsgi.py
文件可能如下所示:

import os.path

from pyramid.paster import get_app
from pyramid.paster import setup_logging

here = os.path.dirname(os.path.abspath(__file__))
inipath = os.path.join(here, 'production.ini')

setup_logging(inipath)
application = get_app(inipath)
这将配置应用程序以加载与
wsgi.py
文件位于同一文件夹中的
production.ini
文件