Django的媒体编辑器小部件
django-mediumeditor的Python项目详细描述
#django medium editor
将[medium editor](https://yabwe.github.io/medium-editor/)添加到[django](https://www.djangoproject.com/)。
通过pypi安装**django mediumeditor**
安装app
````
```
…
‘mediumeditor’,
]
```
`
`
` `
` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
mymodel admin类(mediumeditoradmin,admin.modeladmin:
…
mediumeditor_fields=(“我的文本_field”,)
…
````
覆盖来自mediumeditor的字段
```
的小部件。小部件导入mediumeditorextarea
…
class meta:
model=mymodel
widgets={
“我的文本”字段:mediumeditorextarea(),
}
````
>2.在模板
```
{{form.media}
````
{{form.media}}
````
{settings
选项中,更改主题或更改媒体编辑器选项。py
```
````theme options`default`,`roman`,`mani`,`flat`,`bootstrap`,`tim`,` beagle `
medium-editor'u theme='beagle''default`是defualt theme
medium-editor'u options={..}
````
[可用选项](https://github.com/yabwe/medium editor/blob/master/options.md)
例如:
`````````
medium-editor'u theme='bootstrap'
medium-editor'medium-editor'u theme='bootstrap'
medium-editor'medium-editor'u-editor'options=={
'toolbar
'按钮':[
'粗体',
'斜体',
'下划线',
'删除线',
'下标',
'上标',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
]
},
“粘贴”:{
“强制明文”:真,
“cleanpastedhtml”:假,
“cleanplacements”:[],
“cleanattrs”:[“类”,“样式”,“目录”],
‘cleantags’:['meta']
}
}
`````
https://github.com/g3rd/django mediumeditor/blob/master/license
将[medium editor](https://yabwe.github.io/medium-editor/)添加到[django](https://www.djangoproject.com/)。
通过pypi安装**django mediumeditor**
安装app
````
```
…
‘mediumeditor’,
]
```
`
`
` `
` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
mymodel admin类(mediumeditoradmin,admin.modeladmin:
…
mediumeditor_fields=(“我的文本_field”,)
…
````
覆盖来自mediumeditor的字段
```
的小部件。小部件导入mediumeditorextarea
class meta:
model=mymodel
widgets={
“我的文本”字段:mediumeditorextarea(),
}
````
>2.在模板
```
{{form.media}
````
{{form.media}}
````
{settings
选项中,更改主题或更改媒体编辑器选项。py
```
````theme options`default`,`roman`,`mani`,`flat`,`bootstrap`,`tim`,` beagle `
medium-editor'u theme='beagle''default`是defualt theme
medium-editor'u options={..}
````
[可用选项](https://github.com/yabwe/medium editor/blob/master/options.md)
例如:
`````````
medium-editor'u theme='bootstrap'
medium-editor'medium-editor'u theme='bootstrap'
medium-editor'medium-editor'u-editor'options=={
'toolbar
'按钮':[
'粗体',
'斜体',
'下划线',
'删除线',
'下标',
'上标',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
]
},
“粘贴”:{
“强制明文”:真,
“cleanpastedhtml”:假,
“cleanplacements”:[],
“cleanattrs”:[“类”,“样式”,“目录”],
‘cleantags’:['meta']
}
}
`````
https://github.com/g3rd/django mediumeditor/blob/master/license