一般讨论
django上传图片问题
在windows环境下,能正常上传图片到指定的目录,当把代码部署到centos后,图片就上传不了了;需要做哪些修改吗?求指导下: windows下 setting: MEDIA_ROOT = 'E:\file'
centos下 setting: MEDIA_ROOT = '/usr/local/src/webroot/file/' MEDIA_URL = 'media/' ng配置: location /media/{ root /usr/local/src/webroot/file/; break; }
参与讨论 2
settings.py里建议不要用绝对地址,用相对地址。nginx可以用绝对地址。