I have a RichTextUploadField in my models which is added by ckeditor's library. I want to add a support to create simple html field related content which includes some img and audio tags. I have added a support to upload html content through admin just have no idea how to add support to create through API endpoint?
models.py
from ckeditor_uploader.fields import RichTextUploadingField
class Part(models.Model):
title = models.CharField(max_length=255)
textfield = RichTextUploadingField()
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ('-created_at', )
def __str__(self):
return str(self.explanation)
settings.py (!some parts)
...
INSTALLED_APPS = [
...
# third party installed apps
'rest_framework',
'ckeditor',
'ckeditor_uploader',
...
]
CKEDITOR_UPLOAD_PATH = "uploads/"
...
### I am using html5audio package to upload audios
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'full',
'extraPlugins': ','.join(
[
'html5audio',
]
),
},
}
Question: How can I add support to create HTML content through an REST API endpoint?