在settings.py中加入
ALIYUN_OSS_ACCESS_KEY_ID = 'your_key_id'
ALIYUN_OSS_ACCESS_KEY_SECRET = 'your_access_key'
ALIYUN_OSS_BUCKET_NAME = 'your_bucket_name'
ALIYUN_OSS_ACCESS_HOST = 'your_host_address'
# ALIYUN_OSS_FILE_OVERWRITE = True
DEFAULT_FILE_STORAGE = 'oss_storage.storage.AliyunStorage'