简体   繁体   中英

How do I make a local file public for use on Heroku?

I have built a Dash app which I am attempting to deploy through Heroku.

The app depends on a csv which is stored locally on my machine. When I run the app locally, it runs perfectly. However, when I attempt to deploy the app through Heroku, I get an application error ; the log shows an error that it can't find that csv file.

I am sure that the csv file is spelled correctly and the path is correct (after all, the same fild path runs locally with no problem). However I am getting this error:

 FileNotFoundError: [Errno 2] File b'/Users/adam/Desktop/abc.csv' does not exist: b'/Users/adam/Desktop/abc.csv'

How do I make this file available to heroku?

该错误表明您正在硬编码代码路径并使用本地路径,您必须使用相对路径或更好的方法来检测路径,在 Heroku 上,应用程序路径是/app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM