I want to apply ckeditor on specific textarea in django admin form not on all the text areas.
Like snippet below will apply ckeditor on every textarea present on django form:
class ProjectAdmin(admin.ModelAdmin):
formfield_overrides =
{models.TextField: {'widget': forms.Textarea(attrs={'class':'ckeditor'})}, }
class Media:
js = ('ckeditor/ckeditor.js',)
but i want it on a specific textarea not on every textarea.
You have couple of options.
I think the simplest is if you use Django 1.2, then you have to create custom form for your admin and use 'widgets' option:
If you use older version of Django you can still use custom form, just override the field, in which you want ckEditor, in the form:
Alternative:
Finally for all three options, you set your ProjectAdmin to use ProjectForm: