# Send ckeditor content to server

**URL:** <https://forum.djangoproject.com/t/send-ckeditor-content-to-server/34665>\
**Category:** Forms & APIs\
**Created:** [September 10, 2024, 10:37am UTC](https://forum.djangoproject.com/t/send-ckeditor-content-to-server/34665 "2024-09-10T10:37:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArianN8610](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ariann8610/32/23073_2.png) [@ArianN8610](https://forum.djangoproject.com/u/ArianN8610)\
**Post date:** [September 10, 2024, 10:37am UTC](https://forum.djangoproject.com/t/send-ckeditor-content-to-server/34665/1 "2024-09-10T10:37:47Z")

</div>

I made my own ckeditor structure through [this link](https://ckeditor.com/ckeditor-5/builder/?redirect=docs) and displayed it in my template using vanilla js and CDN.  
Everything works fine and I can edit my texts very easily, but I don’t know how to send the information filled through this box to the view after pressing the submit button and save it in the content field through the ModelForm in database.  
template:

```auto
<link rel="stylesheet" href="{% static 'ckeditor/style.css' %}">
<link rel="stylesheet" href="https://cdn.ckeditor.com/ckeditor5/43.1.0/ckeditor5.css">

<form method="post" enctype="multipart/form-data">
    {% csrf_token %}
    ...
    <div class="main-container">
        <div class="editor-container editor-container_classic-editor editor-container_include-block-toolbar" id="editor-container">
            <div class="editor-container__editor prose">
                <div id="editor"></div>
            </div>
        </div>
    </div>
    <button type="submit">Submit</button>
</form>

<script type="importmap">
    {
        "imports": {
            "ckeditor5": "https://cdn.ckeditor.com/ckeditor5/43.1.0/ckeditor5.js",
            "ckeditor5/": "https://cdn.ckeditor.com/ckeditor5/43.1.0/"
        }
    }
</script>
<script type="module" src="{% static 'ckeditor/main.js' %}"></script>

```

I used the `Feature-rich Editor` option, so the content may contain images or anything other than text, and I don’t know if these can be stored in the TextField or not.  
Of course, in the next step, I chose `Base64 Upload Adapter`, which I don’t know exactly what it does  
view:

```auto
class NewsCreateView(PermissionRequiredMixin, CreateView):
    permission_required = 'news.add_news'
    form_class = forms.NewsCreateForm
    template_name = 'news/news_update_create.html'

    def form_valid(self, form):
        news_form = form.save(commit=False)
        # Do something
        news_form.author = self.request.user.profile
        news_form.save()
        return super().form_valid(form)

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [September 10, 2024, 11:28am UTC](https://forum.djangoproject.com/t/send-ckeditor-content-to-server/34665/2 "2024-09-10T11:28:19Z")

</div>

You might want to look at using one of the CKEditor integration packages in your project, such as [Django-CKEditor](https://django-ckeditor.readthedocs.io/en/latest/). That may be the easiest way to handle this.

---

<div class="post-metadata">

**Author:** ![ArianN8610](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ariann8610/32/23073_2.png) [@ArianN8610](https://forum.djangoproject.com/u/ArianN8610)\
**Post date:** [September 10, 2024, 3:49pm UTC](https://forum.djangoproject.com/t/send-ckeditor-content-to-server/34665/3 "2024-09-10T15:49:11Z")

</div>

Is there any way to do this without django-ckeditor or django-ckeditor-5. Because I want to do things that are not possible with these. Can I distinguish texts and images in view and save them separately?

---

<div class="post-metadata">

**Author:** ![anefta](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anefta/32/10649_2.png) [@anefta](https://forum.djangoproject.com/u/anefta)\
**Post date:** [September 11, 2024, 10:14am UTC](https://forum.djangoproject.com/t/send-ckeditor-content-to-server/34665/4 "2024-09-11T10:14:30Z")

</div>

> [@ArianN8610](#):
>
> Can I distinguish texts and images in view and save them separately

You could create a custom model with texts and images and render them separately - if that is you are asking for

---

<div class="post-metadata">

**Author:** ![bluewaterfoundation](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/bluewaterfoundation/32/25001_2.png) [@bluewaterfoundation](https://forum.djangoproject.com/u/bluewaterfoundation)\
**Post date:** [November 5, 2024, 9:52pm UTC](https://forum.djangoproject.com/t/send-ckeditor-content-to-server/34665/5 "2024-11-05T21:52:54Z")

</div>

The solution you suggest uses ckeditor4. I understood this to no longer be supported: [Deprecated | CKEditor 4 Documentation](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_react_deprecated.html)
