[英]Do I remove STATIC & MEDIA roots when using AWS S3 storage with my Django project?
I'm following this tutorial to integrate AWS S3 storage to my django project.我正在按照本教程将AWS S3 存储集成到我的 django 项目中。 It involves adding a
~/project/app/aws/conf.py
file which includes:它涉及添加一个
~/project/app/aws/conf.py
文件,其中包括:
MEDIA_ROOT = MEDIA_URL
STATIC_URL = S3_URL + 'static/'
Does this mean I should remove the MEDIA_ROOT
and STATIC_URL
from ~/project/app/settings.py
?这是否意味着我应该从
~/project/app/settings.py
删除MEDIA_ROOT
和STATIC_URL
? (and also MEDIA_URL
and STATIC_ROOT
?) (还有
MEDIA_URL
和STATIC_ROOT
?)
是的,您必须这样做,只要您在 settings.py 中导入 conf.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.