django上传文件

django

models中写

file = FileField('选择文档',upload_to='documents/%Y/%m/%d')

upload_to的路径前面不带斜杆,如果写成'/documents/%Y/%m/%d'

可能会出现如下错误

Attempted access to '/documents/%Y/%m/%d'' denied.
posted on 2012-05-13 11:56  呆头龙  阅读(323)  评论(0编辑  收藏  举报

点击这里给我发消息