djace_editor is a reusable application for Django, using Ace editor
Forked on Bradley Ayers.
- Django >= 1.9
- Install djace_editor:
`pip install djace_editor`
- Add 'djace_editor' to INSTALLED_APPS.
from django.db import models
from djace_editor import AceField
class Entry(models.Model):
title = models.CharField(max_length=250, verbose_name=u'Title')
text = AceField(verbose_name=u'Text')
or use custom parametrs:
text = AceField(
verbose_name=u'Text',
theme="terminal",
width="800px",
height="500px"
)
from django import forms
from djace_editor import AceWidget
from blog.models import Entry
class EntryAdminForm(forms.ModelForm):
class Meta:
model = Entry
widgets = {
'short_text': AceWidget(),
}
class EntryAdmin(admin.ModelAdmin):
form = EntryAdminForm
AceWidget takes the same parameters as AceField.
- Fork it!
- Create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request =]