(os.path.dirname(__ file__))在FreeBSD中不起作用

时间:2013-05-10 14:31:58

标签: python django freebsd

我想在我的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/

有人能告诉我出了什么问题......

0 个答案:

没有答案