我,當我嘗試添加個人資料照片在Django管理用戶(127.0.0.1:8000/admin)errno的13權限被拒絕:「/用戶」
誰能幫我這個錯誤消息找出原因?
在/管理/角色/角色OSERROR/6/ [錯誤13]許可被拒絕: '/' 用戶 請求方法:POST 請求URL:http://127.0.0.1:8000/admin/role/role/6/ Django的版本:1.8.2 異常類型:OSError 異常值:
[錯誤13]權限被拒絕:'/ User' 異常位置:/us/wangjohnson/Envs/TUAN/lib/python2.7/os.py makedirs,第157行 Python可執行文件:/ Users/wangjohnson/Envs/TUAN/bin/python 的Python版本:2.7.10 Python的路徑:
[ '/用戶/ wangjohnson/superpm', '/Users/wangjohnson/Envs/TUAN/lib/python27.zip', 「/用戶/ wangjohnson/ENVS/TUAN/lib/python2.7', '/Users/wangjohnson/Envs/TUAN/lib/python2.7/plat-darwin', '/Users/wangjohnson/Envs/TUAN/lib/python2.7/plat- mac', '/Users/wangjohnson/Envs/TUAN/lib/python2.7/plat-mac/lib-scriptpackages', '/ Users/wangjohnson/Envs/TUAN/Extras/lib/python', '/ Users/wangjohnson/Envs/TUAN/lib/python2.7/lib-tk', '/Users/wangjohnson/Envs/TUAN/lib/python2.7/lib-old', '/ Users/wangjohnson/Envs/TUAN/lib/python2.7/lib-dynload', '/ System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/ System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac' , '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/wangjohnson/Envs/TUAN/lib/python2.7/站點包]
model.py
class Role(models.Model):
SEX_CHOICES = {
('MALE','MALE'),
('FEMALE','FEMALE'),
}
name = models.CharField(max_length=20)
role = models.CharField(max_length=30)
sex = models.CharField(max_length=10,choices=SEX_CHOICES)
intro = models.TextField()
age = models.IntegerField()
product = models.ForeignKey(Product,related_name='roles')
photo = models.ImageField(upload_to='photos')
高清的Unicode(個體經營): 回報self.name
settings.py
MEDIA_ROOT = '/User/wangjohnson/superpm/media/'
是的,我有充分的我的文件夾的權限。 – Johnson
0 drwxr-xr-x 12 wangjohnson職員408 10 29 11:45 superpm – Johnson
我找到原因 – Johnson