django /文件上传权限 [英] django / file uploads permissions

查看:338
本文介绍了django /文件上传权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个django应用程序,但是我从Web表单上传文件的权限有一点问题。

I wrote a django app, but i have a little problem with the file permissions of the uploads files from a web form.

基本上我可以上传一个.mp3文件,但它始终保持chmod 600。

Basically I can upload a .mp3 file but it always keep chmod 600.

容器文件夹具有chmod 775,umask设置为022。

The container folder has chmod 775, and the umask is set to 022.

我在一个共享托管服务中。

I'm in a shared hosting service.

推荐答案

在你的settings.py中尝试这个:

Try this in your settings.py:

FILE_UPLOAD_PERMISSIONS = 0644

这篇关于django /文件上传权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆