Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django adding tiny-mce

Tags:

django

Please suggest the best way to add tinymce to django admin area. Is it possible to add it by extending /admin/change_form.html in my template directory ?

like image 987
Vamsi Krishna B Avatar asked Jul 11 '26 07:07

Vamsi Krishna B


2 Answers

The best way in my opinion is django-tinymce.

Its awesome and super easy to integrate into your project, plus you can add django-filebrowser in easily for image uploading.

like image 196
Kevin Avatar answered Jul 14 '26 01:07

Kevin


django-tinymce is the way to go. You can use pip to install it. You use it on model fields like so:

from tinymce import models as tinymce_models
class Foo(models.Model):
    description = tinymce_models.HTMLField(blank=True, null=True, help_text="You can use HTML markup - be careful!")

If you are using South for DB migrations you need to help it out with this line:

add_introspection_rules([], ["^tinymce.models.HTMLField"])

Works like a charm!

like image 29
JohnO Avatar answered Jul 14 '26 01:07

JohnO