我正在尝试在 django admin 中上传图像并获取 OSError(权限被拒绝)。
这是日志:
Request Method: POST
Request URL: .........
Django Version: 1.5.3
Exception Type: OSError
Exception Value:
[Errno 13] Permission denied: .......
Exception Location: /usr/lib/python2.6/os.py in makedirs, line 157
Python Executable: /usr/bin/python
Python Version: 2.6.5
Python Path:
['/home/deployer/virtualenvs/python-2.7.5/lib/python2.7/site-packages',
'/usr/lib/python2.6',
'/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk',
'/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload',
'/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10',
'/usr/lib/pymodules/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.6/gtk-2.0',
'/usr/local/lib/python2.6/dist-packages',
..........]
TRACEBACK:
...........
/home/deployer/virtualenvs/python-2.7.5/lib/python2.7/site-packages/django/core/files/storage.py in _save
*171. os.makedirs(directory)*
/usr/lib/python2.6/os.py in makedirs
*150. makedirs(head, mode)*
/usr/lib/python2.6/os.py in makedirs
*157. mkdir(name, mode)*
在我看来,问题在于错误的 python 路径。但我显然无法改变它。
任何想法如何解决这个问题?