我想传递参数给一个例子WSGI应用:传递命令行参数uwsgi脚本
config_file = sys.argv[1]
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return [b"Hello World %s" % config_file]
并运行:
uwsgi --http :9090 --wsgi-file test_uwsgi.py -???? config_file # argument for wsgi script
任何聪明的办法我能做到吗?无法在uwsgi文档中找到它。也许有另一种方式为wsgi应用程序提供一些参数? (ENV变量超出范围)
应该不是你的'sys.argv'是'[“uwsgi”, 'foo','bar']'? –