Register
Login

Django HTML Admin Widget
3.5.2009

I was a bit annoyed at the lack of WYSIWYG fields for Django's admin interface. I was originally planning to use FCKEditor but couldn't find a polished Django implementation (although I'm sure there is one out there). Instead I opted to use TinyMCE due to this nice Django widget implementation. After running setup.py, installation is a cinch - I just added from tinymce import models as tinymce_models, and replaced instances of models.TextField() with tinymce_models.HTMLField(). To customize the options available to TinyMCE, I was able to add this to my settings.py:

 

TINYMCE_DEFAULT_CONFIG = {
    'theme': "advanced",
    'theme_advanced_toolbar_location': "top",
    'theme_advanced_toolbar_align': "left",
}

 

You can find a complete list of options available to TinyMCE here and a set of buttons included here.

TinyMCE screenshot
comments:
Post

Type the string below:

 _____ _  ____  ____  __
| ____| |/ / \/ \ \/ /
| _| | ' /| |\/| |\ /
| |___| . \| | | |/ \
|_____|_|\_\_| |_/_/\_\

*Comments may take up to 60 seconds to appear.

Anonymous , 8 months, 3 weeks ago
Can haz more blogs?

Reply

Type the string below:

 _____ _  ____  ____  __
| ____| |/ / \/ \ \/ /
| _| | ' /| |\/| |\ /
| |___| . \| | | |/ \
|_____|_|\_\_| |_/_/\_\

*Comments may take up to 60 seconds to appear.