django-redactorjs là một ứng dụng Django thể tái sử dụng cho việc sử dụng trình soạn thảo WYSIWYG http://redactorjs.com/*
Bắt đầu
* Cài đặt django-redactorjs:
pips cài đặt django-redactorjs
* Thêm `'redactor'` để INSTALLED_APPS.
* Thêm 'url (r' ^ người biên soạn / ', bao gồm (' redactor.urls ')) `, để urls.py
* Thêm cấu hình mặc định trong settings.py (cài đặt càng thấy: http://redactorjs.com/docs/settings/):
REDACTOR_OPTIONS = {'lang': 'ru'}
REDACTOR_UPLOAD = 'uploads /'
Sử dụng trong mô hình
mãng xà
từ các mô hình nhập khẩu django.db
từ redactor.fields nhập RedactorField
class Entry (models.Model):
& Nbsp; & nbsp; & nbsp; title = models.CharField (max_length = 250, verbose_name = u'Зaголовок ')
& Nbsp; & nbsp; & nbsp; short_text = RedactorField (verbose_name = u'Крaткий текCт ')
hoặc sử dụng parametrs tùy chỉnh:
short_text = RedactorField (verbose_name = u'Крaткий текCт ',
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; redactor_options = {'lang': 'ru', 'tập trung': 'true'},
& Nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; upload_to = 'tmp /')
Yêu cầu :
- Python
- Django
- PIL
Bình luận không