Trumbowyg (WYSIWYG editor) integration app for Django admin.
Project description
Introduction
django-trumbowyg is the Django-related reusable app for integrating Trumbowyg WYSIWYG editor. It is recognized as one of the best WYSIWYG editors.
Initially this package was forked from Django FS Trumbowyg package and then reworked.
Installation
Install django-trumbowyg using pip:
$ pip install django-trumbowyg
Add 'trumbowyg' to your INSTALLED_APPS setting:
INSTALLED_APPS = ( ... 'trumbowyg', ... )
Update your urls.py:
url(r'^trumbowyg/', include('trumbowyg.urls'))
Sometimes you might want to limit size of uploaded images, e.g. if they are too large. In this case just put in settings (if you omit this, the image will be uploaded unchanged):
TRUMBOWYG_THUMBNAIL_SIZE = (1920, 1080)
The package will look for LANGUAGES setting. Please make sure you have set it otherwise ALL available language files will be loaded, and apparently this is not what you want:
LANGUAGES = ( ('en', 'English'), ('ru', 'Russian'), )
(Optional) If you wish image filenames to be transliterated, install transliterate from PyPi and set:
TRUMBOWYG_TRANSLITERATE_FILENAME = True
Usage
Use TrumbowygWidget in your forms:
from django.forms import ModelForm from django.contrib.admin import ModelAdmin from trumbowyg.widgets import TrumbowygWidget from your_app.models import YourModel class YourModelAdminForm(ModelForm): class Meta: model = YourModel widgets = { 'text': TrumbowygWidget(), } class YourModelAdmin(admin.ModelAdmin): form = YourModelAdminForm admin.site.register(YourModel, YourModelAdmin)
Credits
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for django_trumbowyg-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c580864867d7bf54cbd3596fd2591ebccf129950d1c1e740358ab37c7b41848 |
|
MD5 | bbce98d1ff60f065e4582e8f84a7fa38 |
|
BLAKE2b-256 | 8ff56ffaf702f2833681d251ebeade30696a3a2d0b843e1fa089e9fea227182a |
Hashes for django_trumbowyg-1.0.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cf1c626bdaad541905713c7df7a6c323dbaeef26bc20ac338f571c40adaa2ef |
|
MD5 | 7b3aa0b12e0d9ad4033a46d70fab8821 |
|
BLAKE2b-256 | af5bc2af76223cdf7ffae34e0d292c70f92031092c644ecbaa545ed995da60b8 |