Flask WSGI Apache:应用程序找不到xlsx文件

时间:2016-06-30 09:42:11

标签: apache flask wsgi

我的烧瓶应用程序从存储应用程序的目录中加载xlsx文件。当我使用flask服务器时,这一切都很好,但是使用apache我在日志文件中看到一个错误:

"/app/rplods/thirdparty/apache/htdocs/dbshark/forms.py", line 18, in DroppdownForm, referer: http://xz.com:8000/
[Thu Jun 30 10:36:45.574793 2016] [wsgi:error] [pid 4339:tid 140212003727104] [client 10.65.196.52:14532]     df = pd.read_excel(open('ldm.xlsx', 'rb'), sheetname='Sheet1'), referer: http://xz.com:8000/
[Thu Jun 30 10:36:45.574854 2016] [wsgi:error] [pid 4339:tid 140212003727104] [client 10.65.196.52:14532] FileNotFoundError: [Errno 2] No such file or directory: 'ldm.xlsx', referer: http://xz.com:8000/

如下替换该行并没有任何区别:

here=os.path.dirname(__file__)
g.df = pd.read_excel(open(os.path.join(here, 'ldm.xlsx'), 'rb'), sheetname='Sheet1')

感谢任何建议

0 个答案:

没有答案