django-ckeditor上传图片到阿里云OSS

数据库105

参考信息

资料1: django_ckeditor上传图片到七牛云OSS

使用

1. 安装django-ckeditor 【参考 资料1

2. setting.py配置INSTALLED_APPS 【参考 资料1

3. 编写ckeditor_storage.py

```
class AliyunStorageObject(Storage):
def init(self):
self.now = datetime.datetime.now()
self.file = None

def _new_name(self, name):
    new_name = "file/{0}/{1}.{2}".format(self.now.strftime("%Y/%m/%d"), str(uuid.uuid4()).replace('-', ''),
输入验证码查看隐藏内容

扫描二维码关注本站微信公众号 Johngo学长
或者在微信里搜索 Johngo学长
回复 svip 获取验证码
wechat Johngo学长