jdango 使用oss存储
安装django-aliyun-oss2-storage-0.1.5.tar.gz
settings文件添加
MEDIA_ROOT = os.path.join(BASE_DIR,'upload/')
MEDIA_URL = '/upload/'
DEFAULT_FILE_STORAGE = 'aliyun_oss2_storage.backends.AliyunMediaStorage'
ACCESS_KEY_ID = "LTAI3D3Gcp5ugd4R"
ACCESS_KEY_SECRET = "LX1MwopRVMyKRlwm88ecTilZ50qipx"
END_POINT = "oss-cn-beijing.aliyuncs.com"
BUCKET_NAME = "zlcc"
BUCKET_ACL_TYPE = "public-read" # private, public-read, public-read-write
# STATICFILES_STORAGE = 'aliyun_oss2_storage.backends.AliyunStaticStorage' #不注释的时候admin后台样式路径错误
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步