DEV Community

Pablo Rivera
Pablo Rivera

Posted on

1 2

TinyMCE Django form won't submit.

I'm building a django application that uses TinyMCE. Forms that had the TinyMCE widget were not submitting.

My models were:

    title = models.CharField(max_length=255)
    slug = models.SlugField(max_length=255)
    content = models.TextField()

The problem is that in order to use TinyMCE you have to change any TextFields to include blank=True.

Your code would end up like so:

    title = models.CharField(max_length=255)
    slug = models.SlugField(max_length=255)
    content = models.TextField(blank=True)

I was using a ModelForm which inherits certain properties from the model.

PS. Spent 2 hours with this. Hope I saved you as much time.

Top comments (1)

Collapse
 
alyahmady profile image
Aly

Thank you for sharing.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay