【发布时间】:2015-07-19 05:16:03
【问题描述】:
我是 python django 框架的新手,我不太明白为什么
os.path.dirname(__file__)
和
os.path.dirname(os.path.dirname(__file__))
返回一个空字符串。
我的文件夹结构如下:
djangoWorkspace/
tangoWithDjangoProject/
rango/
tangoWithDjangoProject/
settings.py
Settings.py 包含目录名的代码。
【问题讨论】:
-
我看到了,但它没有回答我的问题。
-
Python 和 Django 版本是什么?
-
python 是 2.7.6,django 是 1.7
-
settings.py中
print __file__的输出是什么?