Skip to main content

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

  1. Install django-trumbowyg using pip:

    $ pip install django-trumbowyg
    
  2. Add 'trumbowyg' to your INSTALLED_APPS setting:

    INSTALLED_APPS = (
        ...
        'trumbowyg',
        ...
    )
    
  3. Update your urls.py:

    url(r'^trumbowyg/', include('trumbowyg.urls'))
    
  4. 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)
    
  5. The package will try to use the language defined in LANGUAGE_CODE and if this language isin’t availabe the default is en

  6. (Optional) If you wish image filenames to be transliterated, install unidecode 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.

Filename, size & hash SHA256 hash help File type Python version Upload date
django_trumbowyg-1.1.0-py2-none-any.whl (168.0 kB) Copy SHA256 hash SHA256 Wheel py2 Sep 10, 2018
django_trumbowyg-1.1.0-py3-none-any.whl (168.0 kB) Copy SHA256 hash SHA256 Wheel py3 Sep 10, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page