我想在我的Django项目中设置图像的路径dir ..它工作正常但是当我在FreeBSD上运行脚本时它无法工作......
import os
imagesDirPath = (os.path.dirname(__file__)) + "/couponRestApiApp/stores/images/"
print imagesDirPath
output: /home/vaibhav/TRAC/coupon-rest-api/couponRestApi/couponRestApiApp/stores/images/
上面正在研究我的系统但是在freeBSD上尝试时我得到:
/couponRestApiApp/stores/images/
但它应该是
/home/vaibhav/coupon-rest-api/couponRestApi/couponRestApiApp/stores/images/
有人能告诉我出了什么问题......