Djang1.4 add Rich Text Editor tinymce note to djangoadmin
I wrote a small blog application, but I didn't have a style at all when I added a blog in the background. Every time I wrote my own HTML Tag, I found a rich text.
Add the editor to it.
Here is the tinymce git address:
Https://github.com/aljosa/django-tinymce
First, install:
Sodu install Django-tinymce
Then configure:
Add
Add 'taggit 'to installed_apps to apply
Add in URLs. py
URL (R' ^ tinymce ', include ('tinymce. urls ')),
Last, modify the display settings. Since the display is in admin, modify the admin. py file of the app that requires rich text display.
Before modification, it may be like this:
# Coding: utf8from Django. contrib import adminfrom. Models import post Admin. Site. Register (post)
It looks like this after modification
From Django. DB import modelsfrom Django. contrib import adminfrom tinymce. widgets import tinymcefrom. models import post class postadmin (Admin. modeladmin): formfield_overrides = {models. textfield: {"widget": tinymce},} admin. site. register (post, postadmin)
After the modification is complete, go to admin in the browser and find that the original large input area has become a simple editor with graphic icons.
Of course there are still many ways to add and use. Please refer to the document for configuration.