django上传文件
来源:岁月联盟
时间:2012-05-15
django
models中写
file = FileField('选择文档',upload_to='documents/%Y/%m/%d')
upload_to的路径前面不带斜杆,如果写成'/documents/%Y/%m/%d'
可能会出现如下错误
Attempted access to '/documents/%Y/%m/%d'' denied.
摘自 哇牛