我有一个Python文件一瓶应用 - backend.py。 该文件包含这些定义:
variable = {
'field': [f for f in csv.DictReader(open('../data/fields.csv', 'rb'), delimiter=';')]
}
def run_fcgi():
from bottle import FlupFCGIServer
run(port=8080, server=FlupFCGIServer)
if __name__ == "__main__":
run(host='0.0.0.0', port=8087, server='waitress')
当我运行这个应用程序,如:
python backend.py
应用程序成功启动。
当我运行该应用程序为FCGI应用(fcgi.py)由主管:
#!my_path_to_python
if __name__ == '__main__':
import backend
backend.run_fcgi()
我有一个错误:
Traceback (most recent call last):
File "path_to_my_project/fcgi.py", line 9, in <module>
import backend
File "path_to_my_project/backend.py", line 49, in <module>
'msk': [i for i in csv.DictReader(open('../data/fields.csv', 'rb'), delimiter=';')],
IOError: [Errno 2] No such file or directory: '../data/fields.csv'
有任何想法吗?