简体   繁体   English

在我的 Django 项目中使用 AWS S3 存储时,我是否会删除 STATIC 和 MEDIA 根?

[英]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_ROOTSTATIC_URL (and also MEDIA_URL and STATIC_ROOT ?) (还有MEDIA_URLSTATIC_ROOT ?)

是的,您必须这样做,只要您在 settings.py 中导入 conf.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM