Just another developer blog
Django-admin +Filebrowser +TinyMCE –Grappelli made easy
First of all you have to follow the instruction here.
After that, download the source code of tinyMCE, unzip, grab the ‘tiny_mce’ folder, inside the ‘jscripts’ folder, and put it in the media folder of your project. Ex.:
$ unzip tinymce_3_*.zip $ cp -r tinymce/jscripts/tiny_mce your_media_project_path/tiny_mce
To turn on the wysiwyg on the admin page you need to include the main tiny_mce javascript file and the javascript that convert the textareas on the admin page.
It’ really simple. Open your admin model and add the Meta class with js paths. Ex:
#admin.py of your app
from yourproject.yourapp.models import YourModel
from django.contrib import admin
from django.conf import settings
class YourModelAdmin(admin.ModelAdmin):
class Media:
js = (settings.MEDIA_URL+'tiny_mce/tiny_mce_src.js',
settings.MEDIA_URL+"filebrowser/js/TinyMCEAdmin.js",)
admin.site.register(YourModel,YourModelAdmin)
Now you can put whatever you want on your contents!
about 1 year ago
Thanks dude.
You save me….
about 5 months ago
Thanks.